diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-02-16 19:51:40 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-02-16 19:51:40 +0000 |
commit | 574eae99dcd0c0ca809d11053dd83f3616b97e70 (patch) | |
tree | 8bff0848e0bf9fe53be338931ec4f5d0e3cb9d1d | |
parent | 81a0cab0be422016601881c47a1fbd31e98e5755 (diff) | |
parent | a3f5eafee63a897981203e384f1c6740c3856762 (diff) | |
download | nova-574eae99dcd0c0ca809d11053dd83f3616b97e70.tar.gz nova-574eae99dcd0c0ca809d11053dd83f3616b97e70.tar.xz nova-574eae99dcd0c0ca809d11053dd83f3616b97e70.zip |
Merge "Rename 'connection' to 'driver' in libvirt HostState"
-rwxr-xr-x | nova/virt/libvirt/driver.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 8ce03f13a..386fe836c 100755 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -3306,10 +3306,10 @@ class LibvirtDriver(driver.ComputeDriver): class HostState(object): """Manages information about the compute node through libvirt.""" - def __init__(self, connection): + def __init__(self, driver): super(HostState, self).__init__() self._stats = {} - self.connection = connection + self.driver = driver self.update_status() def get_host_stats(self, refresh=False): @@ -3324,20 +3324,20 @@ class HostState(object): """Retrieve status info from libvirt.""" LOG.debug(_("Updating host stats")) data = {} - data["vcpus"] = self.connection.get_vcpu_total() - data["vcpus_used"] = self.connection.get_vcpu_used() - data["cpu_info"] = jsonutils.loads(self.connection.get_cpu_info()) - data["disk_total"] = self.connection.get_local_gb_total() - data["disk_used"] = self.connection.get_local_gb_used() + data["vcpus"] = self.driver.get_vcpu_total() + data["vcpus_used"] = self.driver.get_vcpu_used() + data["cpu_info"] = jsonutils.loads(self.driver.get_cpu_info()) + data["disk_total"] = self.driver.get_local_gb_total() + data["disk_used"] = self.driver.get_local_gb_used() data["disk_available"] = data["disk_total"] - data["disk_used"] - data["host_memory_total"] = self.connection.get_memory_mb_total() + data["host_memory_total"] = self.driver.get_memory_mb_total() data["host_memory_free"] = (data["host_memory_total"] - - self.connection.get_memory_mb_used()) - data["hypervisor_type"] = self.connection.get_hypervisor_type() - data["hypervisor_version"] = self.connection.get_hypervisor_version() - data["hypervisor_hostname"] = self.connection.get_hypervisor_hostname() + self.driver.get_memory_mb_used()) + data["hypervisor_type"] = self.driver.get_hypervisor_type() + data["hypervisor_version"] = self.driver.get_hypervisor_version() + data["hypervisor_hostname"] = self.driver.get_hypervisor_hostname() data["supported_instances"] = \ - self.connection.get_instance_capabilities() + self.driver.get_instance_capabilities() self._stats = data |