summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-07-27 19:15:04 +0000
committerJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-07-27 19:15:04 +0000
commiteef8556444de21623da8c750dad37c506be5c484 (patch)
tree39c9efe2636fff91a2ca1952e1b7c6b79b08e583 /nova
parent0bd693056e04f97345e76ab06a9c4344d4a4cfaf (diff)
xenapi: Use instance uuid when calling DB API
The preferred form of calling the DB API is to use the instance UUID instead of the older instance id. Update that and use the dict form to be more compatible with blueprint no-db-messaging. Change-Id: Ib1a06b5385ec627f3daad5bafb3fa1be956a64e2
Diffstat (limited to 'nova')
-rw-r--r--nova/virt/xenapi/host.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/virt/xenapi/host.py b/nova/virt/xenapi/host.py
index 6594600d5..df6b4f85d 100644
--- a/nova/virt/xenapi/host.py
+++ b/nova/virt/xenapi/host.py
@@ -78,7 +78,7 @@ class Host(object):
dest = _host_find(ctxt, self._session, host, host_ref)
(old_ref, new_ref) = db.instance_update_and_get_original(
ctxt,
- instance.id,
+ instance['uuid'],
{'host': dest,
'task_state': task_states.MIGRATING})
notifications.send_update(ctxt, old_ref, new_ref)
@@ -89,7 +89,7 @@ class Host(object):
(old_ref, new_ref) = db.instance_update_and_get_original(
ctxt,
- instance.id,
+ instance['uuid'],
{'vm_state': vm_states.ACTIVE})
notifications.send_update(ctxt, old_ref, new_ref)
@@ -99,7 +99,7 @@ class Host(object):
'from %(host)s' % locals())
(old_ref, new_ref) = db.instance_update_and_get_original(
ctxt,
- instance.id,
+ instance['uuid'],
{'hosts': host,
'vm_state': vm_states.ACTIVE})
notifications.send_update(ctxt, old_ref, new_ref)