summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2013-02-15 15:41:33 +0000
committerDaniel P. Berrange <berrange@redhat.com>2013-02-16 10:39:35 +0000
commita3f5eafee63a897981203e384f1c6740c3856762 (patch)
tree82c194598ec20e096a11002d3b55a1fdce8a0791
parent5ec38e6a576e0102a951e45d6ee2753450bcd3f4 (diff)
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 <berrange@redhat.com>
-rwxr-xr-xnova/virt/libvirt/driver.py26
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