~ubuntu-archive/ubuntu-archive-scripts/trunk

« back to all changes in this revision

Viewing changes to generate-team-p-m

  • Committer: Sebastien Bacher
  • Date: 2020-07-01 09:27:07 UTC
  • mfrom: (281.1.9 ubuntu-archive-scripts)
  • Revision ID: seb128@ubuntu.com-20200701092707-hurew8hvllxtav33
the 'verdict" entries in the autopkgtest sections are not packages

fix the code with the new britney output

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import os
24
24
import threading
25
25
from urllib.request import urlopen
 
26
import urllib.error
26
27
 
27
28
import attr
28
29
from jinja2 import Environment, FileSystemLoader
29
30
import yaml
 
31
import lzma
30
32
 
31
33
env = Environment(
32
34
    loader=FileSystemLoader(os.path.dirname(os.path.abspath(__file__)) + '/templates'),
238
240
 
239
241
    print("fetching yaml")
240
242
    if args.excuses_yaml:
241
 
        yaml_text = open(args.excuses_yaml).read()
 
243
        yaml_text = open(args.excuses_yaml)
242
244
    else:
243
 
        yaml_text = urlopen("https://people.canonical.com/~ubuntu-archive/proposed-migration/update_excuses.yaml").read()
 
245
        try:
 
246
            yaml_text = lzma.open(urlopen("https://people.canonical.com/~ubuntu-archive/proposed-migration/update_excuses.yaml.xz"))
 
247
        except urllib.error.HTTPError as e:
 
248
            print("Reading fallback yaml (%s)" % e)
 
249
            yaml_text = urlopen("https://people.canonical.com/~ubuntu-archive/proposed-migration/update_excuses.yaml")
244
250
    print("parsing yaml")
245
251
    # The CSafeLoader is ten times faster than the regular one
246
252
    excuses = yaml.load(yaml_text, Loader=yaml.CSafeLoader)
256
262
        in_proposed_packages[source_package_name] = prob
257
263
        prob.regressions = []
258
264
        prob.waiting = []
 
265
        # The verdict entries are not items to list on the report
 
266
        for policy in ['autopkgtest', 'update-excuse', 'block-bugs']:
 
267
            try:
 
268
                del item['policy_info'][policy]['verdict']
 
269
            except KeyError:
 
270
                pass
259
271
        if 'autopkgtest' in item['reason']:
260
272
            for package, results in sorted(item['policy_info']['autopkgtest'].items()):
261
273
                regr_arches = []