From b7807106233ad1230211626e4288232ee09a9c02 Mon Sep 17 00:00:00 2001 From: Tim Andersson Date: Tue, 16 Apr 2024 17:13:17 +0100 Subject: [PATCH] Fix: autopkgtest now returns content-length header again reverts commit 25eb52aa3386ecbccd2d9c8dafd22498d40e2002 This must be reverted so that britney is aware of short reads of the db. --- britney2/policies/autopkgtest.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py index de7af7b..1dd3be4 100644 --- a/britney2/policies/autopkgtest.py +++ b/britney2/policies/autopkgtest.py @@ -181,8 +181,7 @@ class AutopkgtestPolicy(BasePolicy): if not data: break f_out.write(data) - content_length = f.getheader('content-length') - if http_code and content_length and os.path.getsize(new_file) != content_length: + if http_code and os.path.getsize(new_file) != int(f.getheader('content-length')): self.logger.info('Short read downloading autopkgtest results') os.unlink(new_file) else: