Fix libvirt forbidden error in set_boot_mode
get_xml_desc (unless dump_sensitive=False) requires a read-write libvirt connection. set_boot_mode was calling this using a read-only connection. Related to: I562e19a4290df64010ef59f6c5d9f49aeb09a693 Story: 2010575 Task: 47322 Change-Id: I60a8a8b5678e548541c05ea1066032a338013aff
This commit is contained in:
parent
af7de384e2
commit
0a8c1b0d62
@ -0,0 +1,5 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixes ``libvirtError: operation forbidden`` when setting boot mode
|
||||
|
@ -513,7 +513,7 @@ class LibvirtDriver(AbstractSystemsDriver):
|
||||
:raises: `error.FishyError` if boot mode can't be set
|
||||
"""
|
||||
|
||||
domain = self._get_domain(identity, readonly=True)
|
||||
domain = self._get_domain(identity)
|
||||
|
||||
# XML schema:
|
||||
# https://libvirt.org/formatdomain.html#operating-system-booting
|
||||
|
@ -360,7 +360,7 @@ class LibvirtDriverTestCase(base.BaseTestCase):
|
||||
with open('sushy_tools/tests/unit/emulator/domain.xml', 'r') as f:
|
||||
data = f.read()
|
||||
|
||||
conn_mock = libvirt_mock.return_value
|
||||
conn_mock = libvirt_rw_mock.return_value
|
||||
domain_mock = conn_mock.lookupByUUID.return_value
|
||||
domain_mock.XMLDesc.return_value = data
|
||||
|
||||
@ -378,7 +378,7 @@ class LibvirtDriverTestCase(base.BaseTestCase):
|
||||
'r') as f:
|
||||
data = f.read()
|
||||
|
||||
conn_mock = libvirt_mock.return_value
|
||||
conn_mock = libvirt_rw_mock.return_value
|
||||
domain_mock = conn_mock.lookupByUUID.return_value
|
||||
domain_mock.XMLDesc.return_value = data
|
||||
|
||||
@ -406,7 +406,7 @@ class LibvirtDriverTestCase(base.BaseTestCase):
|
||||
|
||||
data = ET.tostring(tree)
|
||||
|
||||
conn_mock = libvirt_mock.return_value
|
||||
conn_mock = libvirt_rw_mock.return_value
|
||||
domain_mock = conn_mock.lookupByUUID.return_value
|
||||
domain_mock.XMLDesc.return_value = data
|
||||
|
||||
@ -428,7 +428,7 @@ class LibvirtDriverTestCase(base.BaseTestCase):
|
||||
|
||||
data = ET.tostring(tree)
|
||||
|
||||
conn_mock = libvirt_mock.return_value
|
||||
conn_mock = libvirt_rw_mock.return_value
|
||||
domain_mock = conn_mock.lookupByUUID.return_value
|
||||
domain_mock.XMLDesc.return_value = data
|
||||
|
||||
@ -450,7 +450,7 @@ class LibvirtDriverTestCase(base.BaseTestCase):
|
||||
|
||||
data = ET.tostring(tree)
|
||||
|
||||
conn_mock = libvirt_mock.return_value
|
||||
conn_mock = libvirt_rw_mock.return_value
|
||||
domain_mock = conn_mock.lookupByUUID.return_value
|
||||
domain_mock.XMLDesc.return_value = data
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user