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
This commit is contained in:
@@ -507,6 +507,9 @@ class Connection(object):
|
|||||||
def getVersion(self):
|
def getVersion(self):
|
||||||
return 14000
|
return 14000
|
||||||
|
|
||||||
|
def getHostname(self):
|
||||||
|
return 'compute1'
|
||||||
|
|
||||||
def getCapabilities(self):
|
def getCapabilities(self):
|
||||||
return '''<capabilities>
|
return '''<capabilities>
|
||||||
<host>
|
<host>
|
||||||
|
|||||||
@@ -1695,6 +1695,9 @@ class HostStateTestCase(test.TestCase):
|
|||||||
def get_hypervisor_version(self):
|
def get_hypervisor_version(self):
|
||||||
return 13091
|
return 13091
|
||||||
|
|
||||||
|
def get_hypervisor_hostname(self):
|
||||||
|
return 'compute1'
|
||||||
|
|
||||||
def get_disk_available_least(self):
|
def get_disk_available_least(self):
|
||||||
return 13091
|
return 13091
|
||||||
|
|
||||||
@@ -1721,6 +1724,7 @@ class HostStateTestCase(test.TestCase):
|
|||||||
self.assertEquals(stats["host_memory_free"], 409)
|
self.assertEquals(stats["host_memory_free"], 409)
|
||||||
self.assertEquals(stats["hypervisor_type"], 'QEMU')
|
self.assertEquals(stats["hypervisor_type"], 'QEMU')
|
||||||
self.assertEquals(stats["hypervisor_version"], 13091)
|
self.assertEquals(stats["hypervisor_version"], 13091)
|
||||||
|
self.assertEquals(stats["hypervisor_hostname"], 'compute1')
|
||||||
|
|
||||||
|
|
||||||
class NWFilterFakes:
|
class NWFilterFakes:
|
||||||
|
|||||||
Reference in New Issue
Block a user