diff options
| author | Mark Washenberger <mark.washenberger@rackspace.com> | 2011-03-23 12:17:48 -0400 |
|---|---|---|
| committer | Mark Washenberger <mark.washenberger@rackspace.com> | 2011-03-23 12:17:48 -0400 |
| commit | 48c04eb35fae704913e9ed05868d1334ee5458fa (patch) | |
| tree | dc5ed3239f32e4d8f0b84a5507d02e9f25f9b5bf /nova/api | |
| parent | 493e87976b7eb273f4115d46c91ad73671abb796 (diff) | |
add changePassword action to os api v1.1
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/servers.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 73843f63e..90f709a47 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -256,6 +256,7 @@ class Controller(wsgi.Controller): resize a server""" actions = { + 'changePassword': self._action_change_password, 'reboot': self._action_reboot, 'resize': self._action_resize, 'confirmResize': self._action_confirm_resize, @@ -269,6 +270,9 @@ class Controller(wsgi.Controller): return actions[key](input_dict, req, id) return faults.Fault(exc.HTTPNotImplemented()) + def _action_change_password(self, input_dict, req, id): + return exc.HTTPNotImplemented() + def _action_confirm_resize(self, input_dict, req, id): try: self.compute_api.confirm_resize(req.environ['nova.context'], id) @@ -555,6 +559,15 @@ class ControllerV11(Controller): def _get_addresses_view_builder(self, req): return nova.api.openstack.views.addresses.ViewBuilderV11(req) + def _action_change_password(self, input_dict, req, id): + context = req.environ['nova.context'] + if not 'changePassword' in input_dict \ + or not 'adminPass' in input_dict['changePassword']: + return exc.HTTPBadRequest() + password = input_dict['changePassword']['adminPass'] + self.compute_api.set_admin_password(context, id, password) + return exc.HTTPAccepted() + class ServerCreateRequestXMLDeserializer(object): """ |
