mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-13 15:37:02 +00:00
Patch fetch_db to handle missing 'content-length' header
We don't know why the autopkgtest webserver has stopped providing a Content-Length header but the current code doesn't handle its absence, so detect this rather than throwing an exception. Should be reverted once the header is back, we don't want to be in the dark about short reads of the db.
This commit is contained in:
parent
9e28fceafa
commit
25eb52aa33
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user