Merge lp:~laney/ubuntu-archive-tools/r-a-r-excuses-xz into lp:ubuntu-archive-tools

Proposed by Iain Lane
Status: Merged
Approved by: Steve Langasek
Approved revision: 1340
Merged at revision: 1341
Proposed branch: lp:~laney/ubuntu-archive-tools/r-a-r-excuses-xz
Merge into: lp:ubuntu-archive-tools
Diff against target: 42 lines (+12/-3)
1 file modified
retry-autopkgtest-regressions (+12/-3)
To merge this branch: bzr merge lp:~laney/ubuntu-archive-tools/r-a-r-excuses-xz
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Review via email: mp+386686@code.launchpad.net
To post a comment you must log in.
1340. By Iain Lane

retry-autopkgtest-regressions: Try update_excuses.yaml.xz before update_excuses.yaml

The upcoming proposed-migration deployment will use this filename.

Revision history for this message
Steve Langasek (vorlon) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'retry-autopkgtest-regressions'
2--- retry-autopkgtest-regressions 2020-06-30 23:08:20 +0000
3+++ retry-autopkgtest-regressions 2020-07-01 16:28:42 +0000
4@@ -25,6 +25,7 @@
5 import urllib.request
6 import urllib.parse
7 import argparse
8+import lzma
9 import os
10 import re
11 import yaml
12@@ -108,7 +109,15 @@
13 prev_timestamp = datetime.fromtimestamp(prev_mtime, tz=tzutc())
14 new_timestamp = datetime.now(tz=tzutc()).timestamp()
15
16- f = urllib.request.urlopen(excuses_url)
17+ try:
18+ f = lzma.open(urllib.request.urlopen(excuses_url))
19+ except urllib.error.HTTPError as e:
20+ if e.code == 404:
21+ # some versions of britney output this file uncompressed, try that
22+ # location too
23+ f = urllib.request.urlopen(excuses_url.rstrip('.xz'))
24+ else:
25+ raise
26 if cache_file:
27 remote_ts = dateutil.parser.parse(f.headers['last-modified'])
28 if remote_ts > prev_timestamp:
29@@ -177,11 +186,11 @@
30 break
31 if excuses_url.startswith('/'):
32 excuses_url = url_root + excuses_url
33- excuses_url = excuses_url.replace('.html', '.yaml')
34+ excuses_url = excuses_url.replace('.html', '.yaml.xz')
35 extra_params += [('ppa', 'ci-train-ppa-service/stable-phone-overlay'),
36 ('ppa', 'ci-train-ppa-service/%s' % ppa_name)]
37 else:
38- excuses_url = 'http://people.canonical.com/~ubuntu-archive/proposed-migration/%s/update_excuses.yaml' % args.series
39+ excuses_url = 'http://people.canonical.com/~ubuntu-archive/proposed-migration/%s/update_excuses.yaml.xz' % args.series
40 regressions = get_regressions(excuses_url, args.series, args.state,
41 args.min_age, args.max_age, args.blocks,
42 args.no_proposed)

Subscribers

People subscribed via source and target branches