Skip to content

Commit

Permalink
Merge pull request #213 from CiscoUcs/fix-getchildren-deprecate
Browse files Browse the repository at this point in the history
Fixed Python3.9 issue and bump up the version to 0.9.12
  • Loading branch information
techyragu authored Aug 30, 2021
2 parents 2336d82 + ed9d92b commit 1e46fa7
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
History
-------

0.9.12 (2021-08-30)
---------------------
* Fixes for python 3.9 compatibility
* Fixes issue in earlier release

0.9.11 (2021-08-25)
---------------------
* Support for UCSM release 4.2(1a)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.9.11
current_version = 0.9.12
commit = False
tag = False

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

setup(
name='ucsmsdk',
version='0.9.11',
version='0.9.12',
description="Python SDK for Cisco UCS",
long_description=readme + '\n\n' + history,
long_description_content_type='text/markdown',
Expand Down
2 changes: 1 addition & 1 deletion ucsmsdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@

__author__ = 'Cisco Systems Inc'
__email__ = 'ucs-python@cisco.com'
__version__ = '0.9.11'
__version__ = '0.9.12'
2 changes: 1 addition & 1 deletion ucsmsdk/ucscore.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def from_xml(self, elem, handle=None):
self.attr_set(ucsgenutils.convert_to_python_var_name(
attr_name), str(attr_value))

child_elems = elem.getchildren()
child_elems = list(elem)
if child_elems:
for child_elem in child_elems:
if not ET.iselement(child_elem):
Expand Down
2 changes: 1 addition & 1 deletion ucsmsdk/ucsmethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def from_xml(self, elem, handle=None):
ExternalMethod._external_method_attrs[attr_name],
str(attr_value))

child_elems = elem.getchildren()
child_elems = list(elem)
if child_elems:
for child_elem in child_elems:
if not ET.iselement(child_elem):
Expand Down
4 changes: 2 additions & 2 deletions ucsmsdk/ucsmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def from_xml(self, elem, handle=None):
self.__set_prop("rn", os.path.basename(self.dn), forced=True)
self.mark_clean()

child_elems = elem.getchildren()
child_elems = list(elem)
if child_elems:
for child_elem in child_elems:
if not ET.iselement(child_elem):
Expand Down Expand Up @@ -624,7 +624,7 @@ def from_xml(self, elem, handle=None):
# else:
# raise ValueError("Both rn and dn does not present.")

children = elem.getchildren()
children = list(elem)
if children:
for child in children:
if not ET.iselement(child):
Expand Down
6 changes: 3 additions & 3 deletions ucsmsdk/utils/convertfrombackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def __str__(self):

def _process_child_elem(elem, tag, node, iter_count):
call_count = iter_count
for child in elem.getchildren():
for child in list(elem):
if _ignore_elem(child):
continue

Expand Down Expand Up @@ -235,14 +235,14 @@ def _generate_outer_nodes(elem):
if elem.tag != "topRoot":
return top_nodes

for child in elem.getchildren():
for child in list(elem):
class_id = ucsgenutils.word_u(child.tag)
if not ucscoreutils.is_valid_class_id(class_id) \
or class_id not in classid_dn_map:
continue

parent_nodes = []
for sub_child in child.getchildren():
for sub_child in list(child):
if _ignore_elem(sub_child):
continue

Expand Down

0 comments on commit 1e46fa7

Please sign in to comment.