diff --git a/jss/jssobject.py b/jss/jssobject.py index d747ddc..1a08437 100644 --- a/jss/jssobject.py +++ b/jss/jssobject.py @@ -157,7 +157,7 @@ def _reset_data(self, updated_data): """Clear all children of base element and replace with update""" self.clear() # Convert all incoming data to PrettyElements. - for child in updated_data.getchildren(): + for child in list(updated_data): if not isinstance(child, PrettyElement): child = PrettyElement(child) self._children.append(child) @@ -767,7 +767,7 @@ def add_object_to_path(self, obj, location): """ location = self._handle_location(location) location.append(obj.as_list_data()) - results = [item for item in location.getchildren() if + results = [item for item in list(location) if item.findtext("id") == obj.id][0] return results @@ -782,10 +782,10 @@ def remove_object_from_list(self, obj, list_element): list_element = self._handle_location(list_element) if isinstance(obj, Container): - results = [item for item in list_element.getchildren() if + results = [item for item in list(list_element) if item.findtext("id") == obj.id] elif isinstance(obj, (int, string_types)): - results = [item for item in list_element.getchildren() if + results = [item for item in list(list_element) if item.findtext("id") == str(obj) or item.findtext("name") == obj]