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/compute | |
| parent | 065a7ea03d97943cd669948ebaabd5271bf2afef (diff) | |
Converting lock/unlock to use instance objects
Related to blueprint internal-uuids
Change-Id: I5a7842953da64cd2a060e5e384d06cdf535c7a1f
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index a2ae3f5b8..1128da1de 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1506,18 +1506,19 @@ class API(base.Base): context, instance_id) - def lock(self, context, instance_id): + def lock(self, context, instance): """Lock the given instance.""" - self._cast_compute_message('lock_instance', context, instance_id) + self._cast_compute_message('lock_instance', context, instance['uuid']) - def unlock(self, context, instance_id): + def unlock(self, context, instance): """Unlock the given instance.""" - self._cast_compute_message('unlock_instance', context, instance_id) + self._cast_compute_message('unlock_instance', + context, + instance['uuid']) - def get_lock(self, context, instance_id): + def get_lock(self, context, instance): """Return the boolean state of given instance's lock.""" - instance = self.get(context, instance_id) - return instance['locked'] + return self.get(context, instance['uuid'])['locked'] def reset_network(self, context, instance): """Reset networking on the instance.""" |
