summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorMark Washenberger <mark.washenberger@rackspace.com>2011-11-29 11:18:15 -0500
committerMark Washenberger <mark.washenberger@rackspace.com>2011-11-29 11:18:15 -0500
commit97dada8d604def2ac836465c6548a2c1260e87f5 (patch)
tree013055203256538ac9e43a2b0f26b63e960064ce /nova/compute
parente2a5955e7e979ccd039fb77df8b6e7814cdc1aa1 (diff)
Use uuids for compute manager agent update.
Related to blueprint internal-uuids. Change-Id: Ib4406f7fd4e5d91852d63785f596014cc3979fd2
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/manager.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 2eed738c1..db1eee6bf 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -921,17 +921,16 @@ class ComputeManager(manager.SchedulerDependentManager):
self.driver.inject_file(instance_ref, path, file_contents)
@exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
- @checks_instance_lock
- def agent_update(self, context, instance_id, url, md5hash):
+ @checks_instance_lock_uuid
+ def agent_update(self, context, instance_uuid, url, md5hash):
"""Update agent running on an instance on this host."""
context = context.elevated()
- instance_ref = self.db.instance_get(context, instance_id)
- instance_id = instance_ref['id']
+ instance_ref = self.db.instance_get_by_uuid(context, instance_uuid)
instance_state = instance_ref['power_state']
expected_state = power_state.RUNNING
if instance_state != expected_state:
LOG.warn(_('trying to update agent on a non-running '
- 'instance: %(instance_id)s (state: %(instance_state)s '
+ 'instance: %(instance_uuid)s (state: %(instance_state)s '
'expected: %(expected_state)s)') % locals())
nm = instance_ref['name']
msg = _('instance %(nm)s: updating agent to %(url)s') % locals()