From b6c9727f7cd0dc68bf8019833e947ed9b52fbc86 Mon Sep 17 00:00:00 2001 From: Paolo Cozzi Date: Mon, 7 Feb 2022 15:42:50 +0100 Subject: [PATCH] :bug: fix other issues related to python2 to 3 migration --- Lib/helper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/helper.py b/Lib/helper.py index a535276..342427f 100644 --- a/Lib/helper.py +++ b/Lib/helper.py @@ -222,7 +222,7 @@ def getSnapshotXML(self): # now construct all diskspec diskspecs = [] - for disk in self.disks.iterkeys(): + for disk in iter(self.disks): diskspecs += [ "--diskspec %s,file=/var/lib/libvirt/images/snapshot" "_%s_%s-%s.img" % ( @@ -248,7 +248,7 @@ def getSnapshotXML(self): shell=False) # read output in xml - self.snapshot_xml = create_xml.stdout.read() + self.snapshot_xml = create_xml.stdout.read().decode("ascii") # Lancio il comando e aspetto che termini status = create_xml.wait() @@ -312,7 +312,7 @@ def doBlockCommit(self): # A blockcommit for every disks. Using names like libvirt variables. # Base is the original image file - for disk in self.disks.iterkeys(): + for disk in iter(self.disks): # the command to execute my_cmd = ( "virsh blockcommit {domain_name} {disk} --active "