Remove elementtree deprecated methods

All our supported runtimes [1] are compatible with the recommended
alternatives.

`Element.getiterator` [2] is deprecated since python 3.2 and will be removed
in python 3.9, these changes switch usages to Element.iter() [3]

[1] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-train
[2] https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.getiterator
[3] https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.iter

Change-Id: Iaf5291698d866c9c86cda0f255799d8f10fff3dd
This commit is contained in:
Hervé Beraud
2020-06-23 11:26:20 +02:00
parent a123234b00
commit 5d05bcbe14

View File

@@ -235,7 +235,7 @@ class OFConfigClient(app_manager.OSKenApp):
self._validate(tree)
name_spaces = set()
for e in tree.getiterator():
for e in tree.iter():
name_spaces.add(capable_switch.get_ns_tag(e.tag)[0])
print(name_spaces)