From a3f5eafee63a897981203e384f1c6740c3856762 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 15 Feb 2013 15:41:33 +0000 Subject: Rename 'connection' to 'driver' in libvirt HostState The HostState class in the libvirt driver still uses the old 'connection' terminology instead of the preferred 'driver'. Blueprint: compute-driver-events Change-Id: I942237c329abbb0b857a5363ce71bd4b9377470d Signed-off-by: Daniel P. Berrange --- nova/virt/libvirt/driver.py | 26 +++++++++++++------------- 1 file 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 -- cgit