use retry_exceptions
authorSylvestre Ledru <sledru@mozilla.com>
Mon, 08 Dec 2014 17:45:51 +0100
changeset 5252 a6245b38388320339b486fc0d06f63de1ad251a4
parent 5251 6b0be5cdead36d49dc714782451e1be56adb19b5
child 5253 6eef74637b03f15198d6082f7123a3dce426fb1b
push id14
push usersledru@mozilla.com
push dateMon, 08 Dec 2014 16:46:20 +0000
use retry_exceptions
buildbot-helpers/release_sanity.py
--- a/buildbot-helpers/release_sanity.py
+++ b/buildbot-helpers/release_sanity.py
@@ -122,17 +122,17 @@ def get_l10n_changesets(locale_url):
         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))
-        raise
+        raise urllib2.HTTPError
 
 
 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 +140,19 @@ 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))
 
-        success = retry(get_l10n_changesets, kwargs=dict(locale_url=locale_url), attempts=3, sleeptime=1)
+        success = retry(get_l10n_changesets,
+                        kwargs=dict(locale_url=locale_url), attempts=3,
+                        sleeptime=1, retry_exceptions=(urllib2.HTTPError,))
         if success == False:
             error_tally.add('verify_l10n')
     return success
 
 
 def verify_l10n_dashboard(l10n_changesets, l10n_dashboard_version=None):
     """Checks the l10n-changesets against the l10n dashboard"""
     success = True