summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-02-15 17:38:05 +0000
committerJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-02-15 18:52:40 +0000
commit3a95d451edfa622b987cdc8f904cd00262f32cea (patch)
tree73c9b3e9bf3e3cb77b583841796a7ea23b6f4a3a /plugins
parent4c756df0bd48cc5ccbb672be7f2948ec33b6e17f (diff)
downloadnova-3a95d451edfa622b987cdc8f904cd00262f32cea.tar.gz
nova-3a95d451edfa622b987cdc8f904cd00262f32cea.tar.xz
nova-3a95d451edfa622b987cdc8f904cd00262f32cea.zip
Catch httplib.HTTPException as well
Fixes bug 932927 None of the httplib exceptions will get converted into urllib2 exceptions Change-Id: Iad72821fa1ed54fdb213b371223e94e183dec334
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/xenserver/xenapi/etc/xapi.d/plugins/glance4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
index 35f60923c..134840335 100755
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance
@@ -93,6 +93,10 @@ def _download_tarball(request, staging_path):
raise RetryException(error)
except urllib2.URLError, error:
raise RetryException(error)
+ except httplib.HTTPException, error:
+ # httplib.HTTPException and derivatives (BadStatusLine in particular)
+ # don't have a useful __repr__ or __str__
+ raise RetryException('%s: %s' % (error.__class__.__name__, error))
tar_cmd = "tar -zx --directory=%(staging_path)s" % locals()
tar_proc = _make_subprocess(tar_cmd, stderr=True, stdin=True)