Merge "Remove lxml deprecated methods"

This commit is contained in:
Zuul 2020-06-25 14:08:42 +00:00 committed by Gerrit Code Review
commit db916926e5
1 changed files with 5 additions and 5 deletions

View File

@ -213,7 +213,7 @@ class LibvirtConfigDomainCapsDevices(LibvirtConfigObject):
def parse_dom(self, xmldoc): def parse_dom(self, xmldoc):
super().parse_dom(xmldoc) super().parse_dom(xmldoc)
for c in xmldoc.getchildren(): for c in list(xmldoc):
device = self.DEVICE_PARSERS.get(c.tag) device = self.DEVICE_PARSERS.get(c.tag)
if device: if device:
device = device() device = device()
@ -281,7 +281,7 @@ class LibvirtConfigDomainCapsFeatureSev(LibvirtConfigObject):
if xmldoc.get('supported') == 'yes': if xmldoc.get('supported') == 'yes':
self.supported = True self.supported = True
for c in xmldoc.getchildren(): for c in list(xmldoc):
if c.tag == 'reducedPhysBits': if c.tag == 'reducedPhysBits':
self.reduced_phys_bits = int(c.text) self.reduced_phys_bits = int(c.text)
elif c.tag == 'cbitpos': elif c.tag == 'cbitpos':
@ -3326,14 +3326,14 @@ class LibvirtConfigGuestVPMEM(LibvirtConfigGuestDevice):
self.model = xmldoc.get("model") self.model = xmldoc.get("model")
self.access = xmldoc.get("access") self.access = xmldoc.get("access")
for c in xmldoc.getchildren(): for c in list(xmldoc):
if c.tag == "source": if c.tag == "source":
for sub in c.getchildren(): for sub in list(c):
if sub.tag == "path": if sub.tag == "path":
self.source_path = sub.text self.source_path = sub.text
if sub.tag == "alignsize": if sub.tag == "alignsize":
self.align_size = sub.text self.align_size = sub.text
elif c.tag == "target": elif c.tag == "target":
for sub in c.getchildren(): for sub in list(c):
if sub.tag == "size": if sub.tag == "size":
self.target_size = sub.text self.target_size = sub.text