diff options
| author | Dan Prince <dprince@redhat.com> | 2012-05-15 10:54:13 -0400 |
|---|---|---|
| committer | Dan Prince <dprince@redhat.com> | 2012-05-15 11:31:25 -0400 |
| commit | cdcb64f045764017a7fba4d86207e2ec30a957f9 (patch) | |
| tree | 3255c0b4c398a922e2d13ec799470328090ea5a9 /nova/virt | |
| parent | 8823f7bef2142a807b3c92e512f602b6b415a3e2 (diff) | |
Implement get_hypervisor_hostname for libvirt.
Implements get_hypervisor_hostname so that the
OS-EXT-SRV-ATTR:hypervisor_hostname extension can properly
display this information when using libvirt.
Fixes LP Bug #999729.
Change-Id: I124d48ca352dc225f88999046f9d212ffb9e4c6e
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/libvirt/connection.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py index a5c65ff04..507fea973 100644 --- a/nova/virt/libvirt/connection.py +++ b/nova/virt/libvirt/connection.py @@ -1964,6 +1964,10 @@ class LibvirtConnection(driver.ComputeDriver): return method() + def get_hypervisor_hostname(self): + """Returns the hostname of the hypervisor.""" + return self._conn.getHostname() + def get_cpu_info(self): """Get cpuinfo information. @@ -2075,6 +2079,7 @@ class LibvirtConnection(driver.ComputeDriver): 'local_gb_used': self.get_local_gb_used(), 'hypervisor_type': self.get_hypervisor_type(), 'hypervisor_version': self.get_hypervisor_version(), + 'hypervisor_hostname': self.get_hypervisor_hostname(), 'cpu_info': self.get_cpu_info(), 'service_id': service_ref['id'], 'disk_available_least': self.get_disk_available_least()} @@ -2656,6 +2661,7 @@ class HostState(object): 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._stats = data |
