~brian-murray/ubuntu-archive-tools/add-pkg-ime-team

« back to all changes in this revision

Viewing changes to phased-updater

  • Committer: Steve Langasek
  • Date: 2015-05-05 20:49:15 UTC
  • mfrom: (952.1.1 upstream)
  • Revision ID: steve.langasek@canonical.com-20150505204915-x85xew406mh1ks2d
MergeĀ lp:~brian-murray/ubuntu-archive-tools/dont-phase-on-error

Show diffs side-by-side

added added

removed removed

Lines of Context:
372
372
        'package=%s&previous_version=%s&new_version=%s' % \
373
373
        (quote(src_pkg), quote(previous_version), quote(new_version))
374
374
    new_buckets_file = urlopen(new_buckets_url)
375
 
    # LP: #1193022 - 404 returned when a package version is not found
376
 
    if new_buckets_file.getcode() >= 400:
 
375
    # If we don't receive an OK response from the Error Tracker we should not
 
376
    # increment the phased-update-percentage.
 
377
    if new_buckets_file.getcode() != 200:
377
378
        logging.error('HTTP error retrieving %s' % new_buckets_url)
378
 
        return False
 
379
        return True
379
380
    new_buckets_data = json.load(new_buckets_file)
380
381
    if 'error_message' in new_buckets_data.keys():
381
382
        logging.error('Error getting new buckets at %s' % new_buckets_url)
445
446
        (quote(release_name), quote(src_pkg), quote(pvers), quote(version),
446
447
         last_pup, date)
447
448
    rate_file = urlopen(rate_url)
448
 
    if rate_file.getcode() >= 400:
 
449
    # If we don't receive an OK response from the Error Tracker we should not
 
450
    # increment the phased-update-percentage.
 
451
    if rate_file.getcode() != 200:
449
452
        logging.error('HTTP error retrieving %s' % rate_url)
450
 
        return False
 
453
        return True
451
454
    rate_data = json.load(rate_file)
452
455
    if 'error_message' in rate_data.keys():
453
456
        logging.error('Error getting rate at %s' % rate_url)