Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for Autopkg 2.7 support #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jss/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def handle_401(self, r, **kwargs): # type: (requests.Response, dict) -> request
:param kwargs:
:return:
"""
if r.status_code is not 401:
if r.status_code != 401:
return r

logger.debug("Server returned HTTP 401, getting a new token")
Expand Down
10 changes: 5 additions & 5 deletions jss/jssobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand All @@ -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]

Expand Down Expand Up @@ -957,7 +957,7 @@ def has_member(self, device_object):
raise ValueError

return len([device for device in self.findall(container_search) if
device.findtext("id") == device_object.id]) is not 0
device.findtext("id") == device_object.id]) != 0


# class Scoped(Container):
Expand Down