Skip to content

Commit

Permalink
Fix _sync_power_states to obtain correct 'state'.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dprince committed Feb 29, 2012
1 parent 9540a8c commit 8a143d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nova/compute/manager.py
Expand Up @@ -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"),
Expand Down

0 comments on commit 8a143d3

Please sign in to comment.