Remove elementtree deprecated methods

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

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

[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.getchildren

Change-Id: I3ef75bcb5550b86c0a6702e186b4d285b64af182
This commit is contained in:
Hervé Beraud 2020-06-23 11:31:05 +02:00
parent 2f54c4d654
commit 20913a41b9

View File

@ -62,7 +62,7 @@ class NagiosParser(object):
return services
def _parse_service_row(self, service_row):
columns = service_row.getchildren()
columns = list(service_row)
# service lines have a fixed number of columns.
# there are also two blank lines between different hosts,