raise exception when info reference cant be found

We always assume being able to get the references from a specific URL
although that might not be available (for example if Apache is not
properly setup). Logging an error with the URL we attempted to reach and
raising the urllib2 exception will give an obvious hint to the
administrator.

Change-Id: I0465f8ec0749f6f16d64ddb22dd2ad93dbc42c82
Reviewed-on: https://review.openstack.org/13815
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
changes/27/14327/1
Antoine Musso 11 years ago committed by Jenkins
parent e955e06382
commit ca0466e76d

@ -119,7 +119,11 @@ class Gerrit(object):
def _getInfoRefs(self, project):
url = "https://%s/p/%s/info/refs?service=git-upload-pack" % (
self.server, project)
data = urllib2.urlopen(url).read()
try:
data = urllib2.urlopen(url).read()
except:
self.log.error("Cannot get references from %s" % url)
raise # keeps urllib2 error informations
ret = {}
read_headers = False
read_advertisement = False

Loading…
Cancel
Save