From d2db9790dd1c2f7a955236e01e37b579a2c87321 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Thu, 10 Nov 2011 23:20:52 -0500 Subject: Converting lock/unlock to use instance objects Related to blueprint internal-uuids Change-Id: I5a7842953da64cd2a060e5e384d06cdf535c7a1f --- nova/compute/api.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'nova/compute') 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.""" -- cgit