From eef8556444de21623da8c750dad37c506be5c484 Mon Sep 17 00:00:00 2001 From: Johannes Erdfelt Date: Fri, 27 Jul 2012 19:15:04 +0000 Subject: 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 --- nova/virt/xenapi/host.py | 6 +++--- 1 file 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) -- cgit