Skip to content

align with CME - for pycodestyle issues #50

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

Merged
merged 1 commit into from
Nov 22, 2022
Merged
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 cpapi/api_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ def __init__(self, value):

class TimeoutException(APIException):
def __init__(self, value):
APIException.__init__(self, value, None)
APIException.__init__(self, value, None)
14 changes: 7 additions & 7 deletions cpapi/mgmt_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ def _common_login_logic(self, credentials, continue_last_session, domain, read_o
self.api_version = login_res.data["api-server-version"]
return login_res

def login_with_api_key(self, api_key, continue_last_session=False, domain=None, read_only=False,
payload=None):
def login_with_api_key(self, api_key, continue_last_session=False, domain=None, read_only=False, payload=None):
"""
performs a 'login' API call to the management server

Expand Down Expand Up @@ -349,7 +348,8 @@ def api_call(self, command, payload=None, sid=None, wait_for_task=True, timeout=
res = APIResponse("", False, err_message=err_message)
else:
res = APIResponse("", False, err_message=err)
except (http_client.CannotSendRequest, http_client.BadStatusLine, ConnectionAbortedError, BrokenPipeError, IOError) as e:
except (http_client.CannotSendRequest, http_client.BadStatusLine,
ConnectionAbortedError, BrokenPipeError, IOError) as e:
self.conn = self.create_https_connection()
self.conn.request("POST", url, _data, _headers)
response = self.conn.getresponse()
Expand Down Expand Up @@ -455,8 +455,8 @@ def gen_api_query(self, command, details_level="standard", container_keys=None,
for key in container_keys:
all_objects[key] = []
iterations = 0 # number of times we've made an API call
limit = 50 # page size to get for each api call
offset = 0 # skip n objects in the database
limit = 50 # page size to get for each api call
offset = 0 # skip n objects in the database
if payload is None:
payload = {}
else:
Expand Down Expand Up @@ -591,7 +591,7 @@ def check_tasks_status(task_result):
:return:
"""
for task in task_result.data["tasks"]:
if task["status"] == "failed" or task["status"] == "partially succeeded" or task["status"] == "in progress":
if task["status"] == "failed" or task["status"] == "partially succeeded" or task["status"] == "in progress":
task_result.set_success_status(False)
break

Expand All @@ -610,7 +610,7 @@ def check_fingerprint(self):
local_fingerprint = self.read_fingerprint_from_file(self.server)
server_fingerprint = self.get_server_fingerprint()

#Check if fingerprint is passed and matches
# Check if fingerprint is passed and matches
if self.fingerprint == server_fingerprint:
return True

Expand Down