diff options
| author | Brian Waldon <brian.waldon@rackspace.com> | 2011-11-10 23:20:52 -0500 |
|---|---|---|
| committer | Brian Waldon <brian.waldon@rackspace.com> | 2011-11-15 09:02:25 -0800 |
| commit | d2db9790dd1c2f7a955236e01e37b579a2c87321 (patch) | |
| tree | 5709f3a32683049662f32b23ecd9243970e01676 /nova/api | |
| parent | 065a7ea03d97943cd669948ebaabd5271bf2afef (diff) | |
Converting lock/unlock to use instance objects
Related to blueprint internal-uuids
Change-Id: I5a7842953da64cd2a060e5e384d06cdf535c7a1f
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/contrib/admin_actions.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/nova/api/openstack/contrib/admin_actions.py b/nova/api/openstack/contrib/admin_actions.py index 5e0c8571f..81b23a8a0 100644 --- a/nova/api/openstack/contrib/admin_actions.py +++ b/nova/api/openstack/contrib/admin_actions.py @@ -156,7 +156,10 @@ class Admin_actions(extensions.ExtensionDescriptor): """Permit admins to lock a server""" context = req.environ['nova.context'] try: - self.compute_api.lock(context, id) + instance = self.compute_api.get(context, id) + self.compute_api.lock(context, instance) + except exception.InstanceNotFound: + raise exc.HTTPNotFound(_("Server not found")) except Exception: readable = traceback.format_exc() LOG.exception(_("Compute.api::lock %s"), readable) @@ -170,7 +173,10 @@ class Admin_actions(extensions.ExtensionDescriptor): """Permit admins to lock a server""" context = req.environ['nova.context'] try: - self.compute_api.unlock(context, id) + instance = self.compute_api.get(context, id) + self.compute_api.unlock(context, instance) + except exception.InstanceNotFound: + raise exc.HTTPNotFound(_("Server not found")) except Exception: readable = traceback.format_exc() LOG.exception(_("Compute.api::unlock %s"), readable) |
