From 4dc160bf91d21b42363e5187adb96e59f95da717 Mon Sep 17 00:00:00 2001 From: Amir Sadoughi Date: Wed, 16 Jan 2013 13:15:14 -0600 Subject: 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 --- nova/api/openstack/compute/servers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'nova/api') 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): -- cgit