diff --git a/cpapi/api_exceptions.py b/cpapi/api_exceptions.py index 6b6145a..625a01f 100644 --- a/cpapi/api_exceptions.py +++ b/cpapi/api_exceptions.py @@ -15,4 +15,4 @@ def __init__(self, value): class TimeoutException(APIException): def __init__(self, value): - APIException.__init__(self, value, None) \ No newline at end of file + APIException.__init__(self, value, None) diff --git a/cpapi/mgmt_api.py b/cpapi/mgmt_api.py index 5323121..3552b7f 100644 --- a/cpapi/mgmt_api.py +++ b/cpapi/mgmt_api.py @@ -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 @@ -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() @@ -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: @@ -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 @@ -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