diff options
-rw-r--r-- | nova/compute/manager.py | 2 | ||||
-rw-r--r-- | nova/compute/power_state.py | 2 | ||||
-rw-r--r-- | nova/virt/driver.py | 9 | ||||
-rw-r--r-- | nova/virt/libvirt_conn.py | 2 |
4 files changed, 7 insertions, 8 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index d85ead88b..b67b27dd0 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -1001,7 +1001,7 @@ class ComputeManager(manager.Manager): vm_instances = dict((vm.name, vm) for vm in vm_instances) # Keep a list of VMs not in the DB, cross them off as we find them - vms_not_found_in_db = [vm.name for vm in vm_instances] + vms_not_found_in_db = list(vm_instances.keys()) db_instances = self.db.instance_get_all_by_host(context, self.host) diff --git a/nova/compute/power_state.py b/nova/compute/power_state.py index ed50e492e..ef013b2ef 100644 --- a/nova/compute/power_state.py +++ b/nova/compute/power_state.py @@ -51,4 +51,4 @@ def name(code): def valid_states(): - return _STATE_MAP.values() + return _STATE_MAP.keys() diff --git a/nova/virt/driver.py b/nova/virt/driver.py index d01a91b93..e82f49ebe 100644 --- a/nova/virt/driver.py +++ b/nova/virt/driver.py @@ -28,13 +28,13 @@ from nova.compute import power_state class InstanceInfo(object): def __init__(self, name, state): self.name = name - assert state in power_state.valid_states() + assert state in power_state.valid_states(), "Bad state: %s" % state self.state = state class ComputeDriver(object): """Base class for compute drivers. - + Lots of documentation is currently on fake.py. """ @@ -44,7 +44,7 @@ class ComputeDriver(object): def get_info(self, instance_name): """Get the current status of an instance, by name (not ID!) - + Returns a dict containing: :state: the running state, one of the power_state codes :max_mem: (int) the maximum memory in KBytes allowed @@ -78,7 +78,7 @@ class ComputeDriver(object): def get_console_pool_info(self, console_type): """??? - + Returns a dict containing: :address: ??? :username: ??? @@ -228,4 +228,3 @@ class ComputeDriver(object): def inject_network_info(self, instance): """inject network info for specified instance""" raise NotImplementedError() - diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py index e57859f9d..ddc525e06 100644 --- a/nova/virt/libvirt_conn.py +++ b/nova/virt/libvirt_conn.py @@ -255,7 +255,7 @@ class LibvirtConnection(driver.ComputeDriver): def list_instances_detail(self): infos = [] for domain_id in self._conn.listDomainsID(): - domain = self._conn.lookupById(domain_id) + domain = self._conn.lookupByID(domain_id) info = self._map_to_instance_info(domain) infos.append(info) return infos |