mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
virt: Convert cpu_baseline ElementTree to string
In commit 0f5184c
(Remove minidom use in virt module) the value
of `cpu` become `xml.etree.ElementTree.Element` and no longer
has a method `toxml()`. This results in the following error:
$ salt '*' virt.cpu_baseline
host2:
The minion function caused an exception: Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/salt/minion.py", line 1675, in _thread_return
return_data = minion_instance.executors[fname](opts, data, func, args, kwargs)
File "/usr/lib/python3.7/site-packages/salt/executors/direct_call.py", line 12, in execute
return func(*args, **kwargs)
File "/usr/lib/python3.7/site-packages/salt/modules/virt.py", line 4410, in cpu_baseline
return cpu.toxml()
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'toxml'
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
parent
b8f82fadcf
commit
9daaaadc85
1 changed files with 1 additions and 1 deletions
|
@ -4601,7 +4601,7 @@ def cpu_baseline(full=False, migratable=False, out="libvirt", **kwargs):
|
|||
"vendor": cpu.find("vendor").text,
|
||||
"features": [feature.get("name") for feature in cpu.findall("feature")],
|
||||
}
|
||||
return cpu.toxml()
|
||||
return ElementTree.tostring(cpu)
|
||||
|
||||
|
||||
def network_define(name, bridge, forward, ipv4_config=None, ipv6_config=None, **kwargs):
|
||||
|
|
Loading…
Add table
Reference in a new issue