diff options
| author | Amir Sadoughi <amir.sadoughi@gmail.com> | 2013-01-16 13:15:14 -0600 |
|---|---|---|
| committer | Amir Sadoughi <amir.sadoughi@gmail.com> | 2013-01-28 16:11:40 +0000 |
| commit | 4dc160bf91d21b42363e5187adb96e59f95da717 (patch) | |
| tree | 724b27d815e396e968cad954037eab9f985ceae9 /nova/api | |
| parent | c53f746f8e2988214355f129f3f14ad54383e9f6 (diff) | |
Removes retry of set_admin_password
* An RPC timeout may occur if an agent is missing and set_admin_password is
invoked. This causes 500 errors in the OpenStack API.
* Implemented a 501 error in API if the password set fails.
* Modified xenapi agent to use NotImplementedError instead of Exception in
set_admin_password.
* Updated test code around set_admin_password to accept different exceptions.
* Fixes bug 1061045
Change-Id: If7fab56c20f12e0490f4774e00004ed1d94242b9
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/servers.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index f0fdb5a15..a6ad7a93a 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -1163,7 +1163,11 @@ class Controller(wsgi.Controller): msg = _("Invalid adminPass") raise exc.HTTPBadRequest(explanation=msg) server = self._get_server(context, req, id) - self.compute_api.set_admin_password(context, server, password) + try: + self.compute_api.set_admin_password(context, server, password) + except NotImplementedError: + msg = _("Unable to set password on instance") + raise exc.HTTPNotImplemented(explanation=msg) return webob.Response(status_int=202) def _validate_metadata(self, metadata): |
