Include all libvirt domains in Systems
This patch fixes libvirt domains listing so that both active and inactive domains are rendered as available Systems resource. Before this fix, only inactive domains were listed. Change-Id: I7ca5c6e2b53a231c1913160e2f07b45eac6c5f18
This commit is contained in:
parent
ae5065cc56
commit
2dbb808dba
@ -0,0 +1,6 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixes libvirt domains listing so that both active and inactive domains
|
||||
are rendered as available Systems resource. Before this fix, only inactive
|
||||
domains were listed.
|
@ -152,8 +152,7 @@ class LibvirtDriver(AbstractDriver):
|
||||
:returns: list of UUIDs representing the systems
|
||||
"""
|
||||
with libvirt_open(self._uri, readonly=True) as conn:
|
||||
return [conn.lookupByName(domain).UUIDString()
|
||||
for domain in conn.listDefinedDomains()]
|
||||
return [domain.UUIDString() for domain in conn.listAllDomains()]
|
||||
|
||||
def uuid(self, identity):
|
||||
"""Get computer system UUID
|
||||
|
@ -60,7 +60,7 @@ class LibvirtDriverTestCase(base.BaseTestCase):
|
||||
conn_mock = libvirt_mock.return_value
|
||||
domain = mock.MagicMock()
|
||||
domain.UUIDString.return_value = self.uuid
|
||||
conn_mock.listDefinedDomains.return_value = [domain]
|
||||
conn_mock.listAllDomains.return_value = [domain]
|
||||
uuidstring_mock = conn_mock.lookupByName.return_value.UUIDString
|
||||
uuidstring_mock.return_value = self.uuid
|
||||
systems = self.test_driver.systems
|
||||
|
Loading…
Reference in New Issue
Block a user