From f03f59548de5f3b9bb0a90be44b41a9ddcf27854 Mon Sep 17 00:00:00 2001 From: Paul Gevers Date: Wed, 25 Oct 2017 21:46:53 +0200 Subject: [PATCH] Fix logic in exception handling of unknown autopkgtest results --- britney2/policies/autopkgtest.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py index c73be00..e92f0f2 100644 --- a/britney2/policies/autopkgtest.py +++ b/britney2/policies/autopkgtest.py @@ -685,16 +685,14 @@ class AutopkgtestPolicy(BasePolicy): raise KeyError # fall through except KeyError: # Without swift we don't expect new results - if self.options.adt_swift_url.startswith('file://'): - pass - - self.fetch_swift_results(self.options.adt_swift_url, src, arch) - # do we have one now? - try: - self.test_results[trigger][src][arch] - return - except KeyError: - pass + if not self.options.adt_swift_url.startswith('file://'): + self.fetch_swift_results(self.options.adt_swift_url, src, arch) + # do we have one now? + try: + self.test_results[trigger][src][arch] + return + except KeyError: + pass # Don't re-request if it's already pending arch_list = self.pending_tests.setdefault(trigger, {}).setdefault(src, [])