Merge lp:~brian-murray/ubuntu-archive-tools/phased-updater-502 into lp:ubuntu-archive-tools

Proposed by Brian Murray
Status: Merged
Merged at revision: 750
Proposed branch: lp:~brian-murray/ubuntu-archive-tools/phased-updater-502
Merge into: lp:ubuntu-archive-tools
Diff against target: 26 lines (+4/-5)
1 file modified
phased-updater (+4/-5)
To merge this branch: bzr merge lp:~brian-murray/ubuntu-archive-tools/phased-updater-502
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+175414@code.launchpad.net

Description of the change

Also handle a 502 error code when retrieving json files from errors.ubuntu.com. Looking closer at errors I noticed that rate of crashes does not perform a package version lookup so that will not return a 404 so I removed that.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'phased-updater'
2--- phased-updater 2013-06-27 16:04:54 +0000
3+++ phased-updater 2013-07-17 22:11:34 +0000
4@@ -330,8 +330,8 @@
5 (quote(src_pkg), quote(previous_version), quote(new_version))
6 new_buckets_file = urlopen(new_buckets_url)
7 # LP: #1193022 - 404 returned when a package version is not found
8- if new_buckets_file.getcode() == 404:
9- logging.error('404 with %s' % new_buckets_url)
10+ if new_buckets_file.getcode() in [404, 502]:
11+ logging.error('HTTP error retrieving %s' % new_buckets_url)
12 return False
13 try:
14 new_buckets_data = json.load(new_buckets_file)
15@@ -363,9 +363,8 @@
16 '&release=%s&package=%s' % \
17 (quote(release), quote(src_pkg))
18 rate_file = urlopen(rate_url)
19- # LP: #1193022 - 404 returned when a package version is not found
20- if rate_file.getcode() == 404:
21- logging.error('404 with %s' % rate_url)
22+ if rate_file.getcode() == 502:
23+ logging.error('HTTP error retrieving %s' % rate_url)
24 return False
25 rate_data = json.load(rate_file)
26 if 'error_message' in rate_data.keys():

Subscribers

People subscribed via source and target branches