summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Elrod <relrod@redhat.com>2019-10-31 19:00:48 +0000
committerRick Elrod <relrod@redhat.com>2019-10-31 19:00:48 +0000
commit20554ecb418278ec01b1215b85cbd7636e9a1abf (patch)
treef76d9e9e714756310e274dfd46a5d89c20efc656
parenta19b1d77c763df43eaab5bd1d28a6237d00bc836 (diff)
downloadansible-20554ecb418278ec01b1215b85cbd7636e9a1abf.zip
ansible-20554ecb418278ec01b1215b85cbd7636e9a1abf.tar.gz
ansible-20554ecb418278ec01b1215b85cbd7636e9a1abf.tar.xz
virt_boot: force string instead of bytes
Signed-off-by: Rick Elrod <relrod@redhat.com>
-rwxr-xr-xlibrary/virt_boot4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/virt_boot b/library/virt_boot
index b17db48..6280297 100755
--- a/library/virt_boot
+++ b/library/virt_boot
@@ -138,7 +138,7 @@ def detach_disk(domain, doc, device):
source = disk.find('source')
if source is not None and 'file' in source.attrib:
del source.attrib['file']
- domain.updateDeviceFlags(ET.tostring(disk), libvirt.VIR_DOMAIN_AFFECT_CONFIG)
+ domain.updateDeviceFlags(ET.tostring(disk).decode('utf-8'), libvirt.VIR_DOMAIN_AFFECT_CONFIG)
return True
return False
@@ -287,7 +287,7 @@ def main():
changed = True
### save back
- conn.defineXML( ET.tostring(doc) )
+ conn.defineXML( ET.tostring(doc).decode('utf-8') )
if start and not domain.isActive():
changed = True