diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-08-08 16:02:56 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-08-08 16:02:56 +0000 |
commit | 3475662e02945502fc95c2040c9823fbf4e87ead (patch) | |
tree | 5ca87e963128099ea39683c770b621c59acc740a /plugins | |
parent | 386a42512b7a4435d3d4dfe388149cfd1fe89775 (diff) | |
parent | 7aa6f8465ca4d0aed656a1faf271a597fbdb6f05 (diff) | |
download | nova-3475662e02945502fc95c2040c9823fbf4e87ead.tar.gz |
Merge "xenapi: no image upload retry on certain errors"
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/xenserver/xenapi/etc/xapi.d/plugins/glance | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance index d45adab1ac..0413c78c34 100755 --- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/glance @@ -207,17 +207,23 @@ def _upload_tarball(staging_path, image_id, glance_host, glance_port, "Response Status: %i, Response body: %s" % (url, resp.status, resp.read())) - if resp.status == httplib.UNAUTHORIZED: - # NOTE(johngarbutt): little point in retrying when token invalid - raise PluginError("Unauthorized error while uploading " - "image [%s] " - "to glance host [%s:%s]" - % (image_id, glance_host, glance_port)) + if resp.status in (httplib.UNAUTHORIZED, + httplib.REQUEST_ENTITY_TOO_LARGE, + httplib.PRECONDITION_FAILED, + httplib.CONFLICT, + httplib.FORBIDDEN): + # No point in retrying for these conditions + raise PluginError("Got Error response [%i] while uploading " + "image [%s] " + "to glance host [%s:%s]" + % (resp.status, image_id, + glance_host, glance_port)) else: raise RetryableError("Unexpected response [%i] while uploading " - "image [%s] " - "to glance host [%s:%s]" - % (resp.status, image_id, glance_host, glance_port)) + "image [%s] " + "to glance host [%s:%s]" + % (resp.status, image_id, + glance_host, glance_port)) finally: conn.close() |