From 7478b80b8532029f992ecaa48db5dad82474def0 Mon Sep 17 00:00:00 2001 From: Robert Bruce Park Date: Tue, 19 Jan 2016 11:34:12 -0800 Subject: [PATCH] Iterate. --- britney.py | 12 +++++++----- excuse.py | 8 +++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/britney.py b/britney.py index d10a434..84c056f 100755 --- a/britney.py +++ b/britney.py @@ -1963,13 +1963,15 @@ class Britney(object): for passed, adtsrc, adtver, arch_status in autopkgtest.results( e.name, e.ver[1]): for arch, (status, log_url) in arch_status.items(): - history_url = cloud_url % {'h': srchash(adtsrc), 's': adtsrc, - 'r': self.options.series, 'a': arch} - artifact_url = None + kwargs = {} if self.options.adt_ppas: - artifact_url = log_url.replace('log.gz', 'artifacts.tar.gz') + kwargs['artifact_url'] = log_url.replace('log.gz', 'artifacts.tar.gz') + else: + kwargs['history_url'] = cloud_url % { + 'h': srchash(adtsrc), 's': adtsrc, + 'r': self.options.series, 'a': arch} e.addtest('autopkgtest', '%s %s' % (adtsrc, adtver), - arch, status, log_url, history_url, artifact_url) + arch, status, log_url, **kwargs) # hints can override failures if not passed: diff --git a/excuse.py b/excuse.py index 0238798..3e05a06 100644 --- a/excuse.py +++ b/excuse.py @@ -184,12 +184,10 @@ class Excuse(object): for arch in sorted(self.tests[testtype][pkg]): status, log_url, history_url, artifact_url = self.tests[testtype][pkg][arch] label = EXCUSES_LABELS[status] + message = '{arch}' if history_url else '{arch}' + message += ': {label}' if artifact_url: - message = '{arch}: {label} [artifacts]' - elif history_url: - message = '{arch}: {label}' - else: - message = '{arch}: {label}' + message += ' [artifacts]' archmsg.append(message.format(**locals())) res = res + ("
  • %s for %s: %s
  • \n" % (testtype, pkg, ', '.join(archmsg)))