use retry on urlopen (third try)
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 04 Dec 2014 17:00:11 -0800
changeset 5243 82e0bf9ea9e9856961a49e5e13a2538ea463289e
parent 5242 c92f8f2f101fa08c05aef473ca14a07dd967ef9a
child 5244 c4e2a65d7dcbd13265770a03c2838e16251afd16
push id7
push usersledru@mozilla.com
push dateFri, 05 Dec 2014 01:00:13 +0000
use retry on urlopen (third try)
buildbot-helpers/release_sanity.py
--- a/buildbot-helpers/release_sanity.py
+++ b/buildbot-helpers/release_sanity.py
@@ -115,24 +115,25 @@ def query_locale_revisions(l10n_changese
             locale, revision = line.split()
             locales[locale] = revision
     return locales
 
 
 def get_l10n_changesets(locale_url):
     try:
         urllib2.urlopen(locale_url)
+        return True
     except urllib2.HTTPError, e:
         reason = ""
         if hasattr(e, 'reason'):
             # Python 2.6 does not have reason
             reason = e.reason
         log.error("error checking l10n changeset %s: %d %s" % (locale_url, e.code, reason))
-        success = False
         error_tally.add('verify_l10n')
+        return False
 
 
 def verify_l10n_changesets(hgHost, l10n_changesets):
     """Checks for the existance of all l10n changesets"""
     success = True
     locales = query_locale_revisions(l10n_changesets)
     for locale in sorted(locales.keys()):
         revision = locales[locale]
@@ -140,17 +141,17 @@ def verify_l10n_changesets(hgHost, l10n_
             'repoPath': releaseConfig['l10nRepoPath'].strip('/'),
             'locale': locale,
             'revision': revision,
         }
         locale_url = make_hg_url(hgHost, localePath, protocol='https')
         log.info("Checking for existence l10n changeset %s %s in repo %s ..."
                  % (locale, revision, locale_url))
 
-        retry(get_l10n_changesets, args=(locale_url), attempts=3, sleeptime=1)
+        success = retry(get_l10n_changesets, args=(locale_url), attempts=3, sleeptime=1)
     return success
 
 
 def verify_l10n_dashboard(l10n_changesets, l10n_dashboard_version=None):
     """Checks the l10n-changesets against the l10n dashboard"""
     success = True
     locales = query_locale_revisions(l10n_changesets)
     if l10n_dashboard_version: