Move loop-invariant out of loop

Signed-off-by: Niels Thykier <niels@thykier.net>
ubuntu/rebased
Niels Thykier 7 years ago
parent 74fe0c8b8e
commit 499f7d993c

@ -249,6 +249,11 @@ class AutopkgtestPolicy(BasePolicy):
if testsrc == source_name and r - {'RUNNING', 'RUNNING-ALWAYSFAIL', 'ALWAYSFAIL'}: if testsrc == source_name and r - {'RUNNING', 'RUNNING-ALWAYSFAIL', 'ALWAYSFAIL'}:
src_has_own_test = True src_has_own_test = True
if testver:
testname = '%s/%s' % (testsrc, testver)
else:
testname = testsrc
html_archmsg = [] html_archmsg = []
for arch in sorted(arch_results): for arch in sorted(arch_results):
(status, run_id, log_url) = arch_results[arch] (status, run_id, log_url) = arch_results[arch]
@ -272,10 +277,6 @@ class AutopkgtestPolicy(BasePolicy):
('package', testsrc), ('package', testsrc),
('trigger', trigger)] + ('trigger', trigger)] +
[('ppa', p) for p in self.options.adt_ppas]) [('ppa', p) for p in self.options.adt_ppas])
if testver:
testname = '%s/%s' % (testsrc, testver)
else:
testname = testsrc
tests_info.setdefault(testname, {})[arch] = \ tests_info.setdefault(testname, {})[arch] = \
[status, log_url, history_url, artifact_url, retry_url] [status, log_url, history_url, artifact_url, retry_url]
@ -295,7 +296,6 @@ class AutopkgtestPolicy(BasePolicy):
# render HTML line for testsrc entry # render HTML line for testsrc entry
excuse.addhtml("autopkgtest for %s: %s" % (testname, ', '.join(html_archmsg))) excuse.addhtml("autopkgtest for %s: %s" % (testname, ', '.join(html_archmsg)))
if verdict != PolicyVerdict.PASS: if verdict != PolicyVerdict.PASS:
# check for force-skiptest hint # check for force-skiptest hint
hints = self.britney.hints.search('force-skiptest', package=source_name, version=source_data_srcdist.version) hints = self.britney.hints.search('force-skiptest', package=source_name, version=source_data_srcdist.version)

Loading…
Cancel
Save