Fix AttributeError in ce_lacp on Python 3.9.
This commit is contained in:
parent
44d8ce9b31
commit
ac8f1ad4e2
1 changed files with 6 additions and 1 deletions
|
@ -313,7 +313,12 @@ def xml_to_dict(args):
|
|||
root = ET.fromstring(args)
|
||||
ifmtrunk = root.find('.//ifmtrunk')
|
||||
if ifmtrunk is not None:
|
||||
for ele in ifmtrunk.getiterator():
|
||||
try:
|
||||
ifmtrunk_iter = ET.Element.iter(ifmtrunk)
|
||||
except AttributeError:
|
||||
ifmtrunk_iter = ifmtrunk.getiterator()
|
||||
|
||||
for ele in ifmtrunk_iter:
|
||||
if ele.text is not None and len(ele.text.strip()) > 0:
|
||||
rdict[ele.tag] = ele.text
|
||||
return rdict
|
||||
|
|
Loading…
Reference in a new issue