Skip to content

Commit

Permalink
Improved score
Browse files Browse the repository at this point in the history
  • Loading branch information
ABHISHEK-SINHA10 committed Jan 15, 2025
1 parent d2bd4ad commit 7983856
Show file tree
Hide file tree
Showing 6 changed files with 2,694 additions and 2,687 deletions.
3 changes: 2 additions & 1 deletion ProgrammersGuideExamples/file_tree_quota_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
print(QUOTA)

# Get treequota list
filter_dict = {"id": "eq.{0}".format(QUOTA["id"])}
quota_id = QUOTA["id"]
filter_dict = {"id": f"eq.{quota_id}"}
QUOTA_LIST = CONN.provisioning.get_file_tree_quotas(filter_dict=filter_dict)
print(QUOTA_LIST)

Expand Down
3 changes: 2 additions & 1 deletion ProgrammersGuideExamples/file_user_quota_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
print(QUOTA)

# Get userquota list
filter_dict = {"id": "eq.{0}".format(QUOTA["id"])}
quota_id = QUOTA["id"]
filter_dict = {"id": f"eq.{quota_id}"}
QUOTA_LIST = CONN.provisioning.get_file_user_quotas(filter_dict=filter_dict)
print(QUOTA_LIST)

Expand Down
8 changes: 4 additions & 4 deletions PyPowerStore/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,8 @@ def fetch_response(
headers.update(auth_headers)

LOG.debug(
"Request's http_method: '%s' url: '%s' payload: '%s' "
"querystring: '%s' myrange: '%s'"
% (http_method, url, payload, querystring, myrange),
"Request's http_method: '%s' url: '%s' payload: '%s' querystring: '%s' myrange: '%s'"
, http_method, url, payload, querystring, myrange
)
if myrange:
headers["Range"] = myrange
Expand Down Expand Up @@ -432,7 +431,8 @@ def request(self, http_method, url, payload=None, querystring=None, all_pages=No
) from exception
except Timeout as exception:
LOG.error(str(exception))
raise PowerStoreException(PowerStoreException.TIMEOUT_ERROR, str(exception)) from exception
raise PowerStoreException(PowerStoreException.TIMEOUT_ERROR, str(exception)
) from exception
except OSError as exception:
LOG.error(str(exception))
raise PowerStoreException(PowerStoreException.SOCKET_ERR, str(exception)) from exception
21 changes: 13 additions & 8 deletions PyPowerStore/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,8 @@ def modify_security_config(self, security_config_id, protocol_mode):
:rtype: None
"""
LOG.info(
f"Modify security config properties: '{security_config_id}' with params '{protocol_mode}'",
f"Modify security config properties: \
'{security_config_id}' with params '{protocol_mode}'",
)

payload = {}
Expand Down Expand Up @@ -1515,7 +1516,8 @@ def modify_destination_email_details(self, email_id, modify_parameters):
:rtype : None
"""
LOG.info(
f"Modifying destination email properties: '{email_id}' with params '{modify_parameters}'",
f"Modifying destination email properties: \
'{email_id}' with params '{modify_parameters}'",
)

email_url = constants.MODIFY_EMAIL_URL
Expand Down Expand Up @@ -1633,7 +1635,8 @@ def modify_smtp_config_details(self, smtp_id, modify_parameters):
:rtype : None
"""
LOG.info(
f"Modifying SMTP configuration properties: '{smtp_id}' with params '{modify_parameters}'",
f"Modifying SMTP configuration properties: \
'{smtp_id}' with params '{modify_parameters}'",
)

smtp_url = constants.MODIFY_SMTP_URL
Expand Down Expand Up @@ -1933,7 +1936,8 @@ def get_remote_support_contact_list(self, filter_dict=None, all_pages=None):
:rtype: list[dict]
"""
LOG.info(
f"Getting all remote support contact with filter: '{filter_dict}' and all_pages: '{all_pages}'",
f"Getting all remote support contact with filter: \
'{filter_dict}' and all_pages: '{all_pages}'",
)
if helpers.is_foot_hill_or_higher():
querystring = helpers.prepare_querystring(constants.SELECT_ID, filter_dict)
Expand Down Expand Up @@ -1999,7 +2003,8 @@ def modify_remote_support_contact_details(
:rtype : None
"""
LOG.info(
f"Modifying remote support contact : '{remote_support_contact_id}' with params '{modify_parameters}'",
f"Modifying remote support contact : \
'{remote_support_contact_id}' with params '{modify_parameters}'",
)
if helpers.is_foot_hill_or_higher():
remote_support_contact_url = constants.MODIFY_REMOTE_SUPPORT_CONTACT_URL
Expand Down Expand Up @@ -2475,7 +2480,7 @@ def get_storage_container_destination_list(self, filter_dict=None, all_pages=Non
"""
LOG.info(
"Getting storage containers destination with filter: '%s' "
"and all_pages: %s" % (filter_dict, all_pages),
"and all_pages: %s" , filter_dict, all_pages
)
querystring = helpers.prepare_querystring(
constants.STORAGE_CONTAINER_DETAILS_DESTINATION_QUERY, filter_dict,
Expand All @@ -2502,7 +2507,7 @@ def get_storage_container_destination_details(
"""
LOG.info(
"Getting storage container destination details by "
"ID: '%s'" % storage_container_destination_id,
"ID: '%s'" , storage_container_destination_id
)

return self.config_client.request(
Expand Down Expand Up @@ -2536,7 +2541,7 @@ def delete_storage_container_destination(self, storage_container_destination_id)
"""
LOG.info(
"Deleting storage container destination with "
"id: '%s'" % storage_container_destination_id,
"id: '%s'" , storage_container_destination_id,
)
return self.config_client.request(
constants.DELETE,
Expand Down
6 changes: 3 additions & 3 deletions PyPowerStore/protection.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ def get_filesystem_snapshot_details_by_name(
)
LOG.info(
"Getting filesystem snapshot: '%s' details by "
"nasserver id: '%s'" % (snapshot_name, nas_server_id),
"nasserver id: '%s'" , snapshot_name, nas_server_id
)
return self.provisioning.get_filesystem_by_name(
filesystem_name=snapshot_name, nas_server_id=nas_server_id,
Expand Down Expand Up @@ -1058,7 +1058,7 @@ def get_replication_sessions(self, filter_dict=None, all_pages=False):
"""
LOG.info(
"Getting replication sessions with filter: '%s' and "
"all_pages: '%s'" % (filter_dict, all_pages),
"all_pages: '%s'" , filter_dict, all_pages,
)
querystring = helpers.prepare_querystring(constants.SELECT_ID, filter_dict)
LOG.info("Querystring: '%s'", querystring)
Expand Down Expand Up @@ -1190,7 +1190,7 @@ def get_replication_groups(self, filter_dict=None, all_pages=False):
"""
LOG.info(
"Getting replication groups with filter: '%s' and "
"all_pages: %s" % (filter_dict, all_pages),
"all_pages: %s" , filter_dict, all_pages,
)
querystring = helpers.prepare_querystring(
constants.REPLICATION_GROUP_QUERY, filter_dict,
Expand Down
Loading

0 comments on commit 7983856

Please sign in to comment.