From 8a143d3a5ba4f2b2cd1c8a0a95cb0233083d0f8a Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Wed, 29 Feb 2012 14:51:13 -0500 Subject: [PATCH] Fix _sync_power_states to obtain correct 'state'. Update the compute manager to obtain state from the get_info dict correctly. Fixes 'dict' object has no attribute 'state' error that occur when syncing power states. Fixes LP Bug #934276. Change-Id: I3e3602018f4c38f78b48186bfca78eda362a9e54 --- nova/compute/manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index d06786ca0a4..a4a18f1f814 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -2244,7 +2244,7 @@ def _sync_power_states(self, context): db_power_state = db_instance['power_state'] try: vm_instance = self.driver.get_info(db_instance) - vm_power_state = vm_instance.state + vm_power_state = vm_instance['state'] except exception.InstanceNotFound: LOG.warn(_("Instance found in database but not known by " "hypervisor. Setting power state to NOSTATE"),