Revert "Fix: autopkgtest now returns content-length header again"

This reverts commit b7807106233ad1230211626e4288232ee09a9c02.
This commit is contained in:
Tim Andersson 2024-04-25 08:32:06 +01:00
parent b780710623
commit 84d9355125

View File

@ -181,7 +181,8 @@ class AutopkgtestPolicy(BasePolicy):
if not data:
break
f_out.write(data)
if http_code and os.path.getsize(new_file) != int(f.getheader('content-length')):
content_length = f.getheader('content-length')
if http_code and content_length and os.path.getsize(new_file) != content_length:
self.logger.info('Short read downloading autopkgtest results')
os.unlink(new_file)
else: