Fix how we check file size when reading stdout for upgrade

i guess sometimes we were getting a negative number there
This commit is contained in:
Lance Edgar 2018-07-15 17:40:46 -05:00
parent 45f19517d3
commit d3e67ccbcd

View file

@ -343,7 +343,7 @@ class UpgradeView(MasterView):
offset = session.get('stdout.offset', 0) offset = session.get('stdout.offset', 0)
if os.path.exists(path): if os.path.exists(path):
size = os.path.getsize(path) - offset size = os.path.getsize(path) - offset
if size: if size > 0:
with open(path, 'rb') as f: with open(path, 'rb') as f:
f.seek(offset) f.seek(offset)
chunk = f.read(size) chunk = f.read(size)