Skip to content

Commit

Permalink
Improved 9.93
Browse files Browse the repository at this point in the history
  • Loading branch information
ABHISHEK-SINHA10 committed Jan 15, 2025
1 parent 388ba89 commit 0c6d4db
Showing 1 changed file with 49 additions and 26 deletions.
75 changes: 49 additions & 26 deletions PyPowerStore/provisioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,8 @@ def add_protection_policy_for_volume(self, volume_id, protection_policy_id):
:rtype: None
"""
LOG.info(
f"Adding protection policy: '{protection_policy_id}' for volume: '{volume_id}'",
"Adding protection policy: '%s' for volume: '%s'",
protection_policy_id, volume_id
)
payload = self._prepare_modify_volume_payload(
protection_policy_id=protection_policy_id,
Expand Down Expand Up @@ -686,7 +687,8 @@ def unmap_volume_from_host_group(self, volume_id, host_group_id):
:type host_group_id: str
"""
LOG.info(
f"Unmapping volume: '{volume_id}' from host group: '{host_group_id}'",
"Unmapping volume: '%s' from host group: '%s'",
volume_id, host_group_id
)
payload = self._prepare_unmap_vol_from_host_grp_payload(host_group_id)
self.client.request(
Expand Down Expand Up @@ -714,7 +716,8 @@ def get_volumes(self, filter_dict=None, all_pages=False):
:rtype: list of dict
"""
LOG.info(
f"Getting volumes with filter: '{filter_dict}' and all_pages: {all_pages}",
"Getting volumes with filter: '%s' and all_pages: %s",
filter_dict, all_pages
)
querystring = helpers.prepare_querystring(
constants.SELECT_ID_AND_NAME, filter_dict,
Expand Down Expand Up @@ -806,7 +809,8 @@ def configure_metro_volume(
:rtype: str
"""
LOG.info(
f"Configuring the metro volume {volume_id} to remote system {remote_system_id}",
"Configuring the metro volume %s to remote system %s",
volume_id, remote_system_id
)

if helpers.is_foot_hill_prime_or_higher():
Expand Down Expand Up @@ -861,7 +865,8 @@ def get_hosts(self, filter_dict=None, all_pages=False):
:rtype: list of dict
"""
LOG.info(
f"Getting hosts with filter: '{filter_dict}' and all_pages: {all_pages}",
"Getting hosts with filter: '%s' and all_pages: %s",
filter_dict, all_pages
)
querystring = helpers.prepare_querystring(
constants.SELECT_ID_AND_NAME, filter_dict,
Expand Down Expand Up @@ -894,7 +899,8 @@ def create_host(
:rtype: dict
"""
LOG.info(
f"Creating host with name: '{name}' os_type: '{os_type}' initiators: '{initiators}'",
"Creating host with name: '%s' os_type: '%s' initiators: '%s'",
name, os_type, initiators
)
payload = self._prepare_create_host_payload(
name, description, os_type, initiators, host_connectivity,
Expand Down Expand Up @@ -1103,7 +1109,8 @@ def get_host_group_list(self, filter_dict=None, all_pages=False):
:rtype: list of dict
"""
LOG.info(
f"Getting hostgroup with filter: '{filter_dict}' and all_pages: {all_pages}",
"Getting hostgroup with filter: '%s' and all_pages: %s",
filter_dict, all_pages
)
querystring = helpers.prepare_querystring(
constants.SELECT_ID_AND_NAME, filter_dict,
Expand Down Expand Up @@ -1354,7 +1361,8 @@ def get_volume_group_list(self, filter_dict=None, all_pages=False):
:rtype: list of dict
"""
LOG.info(
f"Getting volumegroups with filter: '{filter_dict}' and all_pages: {all_pages}",
"Getting volumegroups with filter: '%s' and all_pages: %s",
filter_dict, all_pages
)
querystring = helpers.prepare_querystring(
constants.SELECT_ID_AND_NAME, filter_dict,
Expand Down Expand Up @@ -1666,7 +1674,8 @@ def add_members_to_volume_group(
:rtype: None
"""
LOG.info(
f"Adding volumes: '{volume_ids}' to volumegroup: '{volume_group_id}'",
"Adding volumes: '%s' to volumegroup: '%s'",
volume_ids, volume_group_id
)
payload = self._prepare_add_members_to_volume_group_payload(
volume_ids, force_internal,
Expand Down Expand Up @@ -1702,7 +1711,8 @@ def remove_members_from_volume_group(
:rtype None or dict
"""
LOG.info(
f"Removing volumes: '{volume_ids}' from volumegroup: '{volume_group_id}'",
"Removing volumes: '%s' from volumegroup: '%s'",
volume_ids, volume_group_id
)
payload = self._prepare_remove_members_from_volume_group_payload(
volume_ids, force_internal,
Expand Down Expand Up @@ -1738,7 +1748,8 @@ def get_nodes(self, filter_dict=None, all_pages=False):
:rtype: list of dict
"""
LOG.info(
f"Getting nodes with filter: '{filter_dict}' and all_pages: {all_pages}",
"Getting nodes with filter: '%s' and all_pages: %s",
filter_dict, all_pages
)
querystring = helpers.prepare_querystring(
constants.SELECT_ID_AND_NAME, filter_dict,
Expand Down Expand Up @@ -1799,7 +1810,8 @@ def get_nas_servers(self, filter_dict=None, all_pages=False):
:rtype: list of dict
"""
LOG.info(
f"Getting nasservers with filter: '{filter_dict}' and all_pages: {all_pages}",
"Getting nasservers with filter: '%s' and all_pages: %s",
filter_dict, all_pages
)
querystring = helpers.prepare_querystring(
constants.SELECT_ID_AND_NAME, filter_dict,
Expand Down Expand Up @@ -1936,7 +1948,8 @@ def get_file_systems(self, filter_dict=None, all_pages=False):
:rtype: list of dict
"""
LOG.info(
f"Getting filesystems with filter: '{filter_dict}' and all_pages: {all_pages}",
"Getting filesystems with filter: '%s' and all_pages: %s",
filter_dict, all_pages
)
querystring = helpers.prepare_querystring(
constants.SELECT_ID_AND_NAME, filter_dict,
Expand Down Expand Up @@ -2112,7 +2125,8 @@ def get_nfs_exports(self, filter_dict=None, all_pages=False):
:rtype: list of dict
"""
LOG.info(
f"Getting nfsexports with filter: '{filter_dict}' and all_pages: {all_pages}",
"Getting nfsexports with filter: '%s' and all_pages: %s",
filter_dict, all_pages
)
querystring = helpers.prepare_querystring(
constants.SELECT_ID_AND_NAME, filter_dict,
Expand Down Expand Up @@ -2199,7 +2213,8 @@ def modify_nfs_export(self, nfs_export_id, nfs_other_params):
:rtype: None
"""
LOG.info(
f"Modifying nfsexport: '{nfs_export_id}' with params: '{nfs_other_params}'",
"Modifying nfsexport: '%s' with params: '%s'",
nfs_export_id, nfs_other_params
)
return self.client.request(
constants.PATCH,
Expand Down Expand Up @@ -2237,7 +2252,8 @@ def get_smb_shares(self, filter_dict=None, all_pages=False):
:rtype: list of dict
"""
LOG.info(
f"Getting smbshares with filter: '{filter_dict}' and all_pages: {all_pages}",
"Getting smbshares with filter: '%s' and all_pages: %s",
filter_dict, all_pages
)
querystring = helpers.prepare_querystring(
constants.SELECT_ALL_SMB_SHARE, filter_dict,
Expand Down Expand Up @@ -2312,7 +2328,7 @@ def create_smb_share(self, file_system_id, path, name, **kw_smb_other_params):
payload=payload,
)

def update_smb_share(self, id, **kw_smb_other_params):
def update_smb_share(self, idd, **kw_smb_other_params):
"""Modify a SMB Share.
:param id: The ID of SMB Share.
Expand All @@ -2321,11 +2337,12 @@ def update_smb_share(self, id, **kw_smb_other_params):
:rtype: None
"""
LOG.info(
f"Modifying smbshare: '{id}' with params: '{kw_smb_other_params}'",
"Modifying smbshare: '%s' with params: '%s'",
idd, kw_smb_other_params
)
return self.client.request(
constants.PATCH,
constants.MODIFY_SMB_SHARE_URL.format(self.server_ip, id),
constants.MODIFY_SMB_SHARE_URL.format(self.server_ip, idd),
payload=kw_smb_other_params,
)

Expand Down Expand Up @@ -2401,7 +2418,8 @@ def get_file_tree_quotas(self, filter_dict=None, all_pages=False):
:rtype: list of dict
"""
LOG.info(
f"Getting tree quotas with filter: '{filter_dict}' and all_pages: {all_pages}",
"Getting tree quotas with filter: '%s' and all_pages: %s",
filter_dict, all_pages
)
querystring = helpers.prepare_querystring(
constants.SELECT_ID_AND_PATH, filter_dict,
Expand All @@ -2427,7 +2445,8 @@ def get_file_user_quotas(self, filter_dict=None, all_pages=False):
:rtype: list of dict
"""
LOG.info(
f"Getting user quotas with filter: '{filter_dict}' and all_pages: {all_pages}",
"Getting user quotas with filter: '%s' and all_pages: %s",
filter_dict, all_pages
)
querystring = helpers.prepare_querystring(filter_dict)
LOG.info( "Querystring: '%s'", querystring)
Expand Down Expand Up @@ -2463,7 +2482,7 @@ def get_tree_quota(self, tree_quota_id, path=None, file_system_id=None):
querystring=constants.SELECT_ALL_TREE_QUOTA,
)
LOG.info(
f"Getting tree quota details by path: '{tree_quota_id}' and fs_id: '{file_system_id}'",
"Getting tree quota details by path: '{tree_quota_id}' and fs_id: '{file_system_id}'",
)
return self.client.request(
constants.GET,
Expand Down Expand Up @@ -2563,7 +2582,8 @@ def update_tree_quota(self, tree_quota_id, tree_quota_params):
:rtype: None
"""
LOG.info(
f"Modifying tree quota: '{tree_quota_id}' with params: '{tree_quota_params}'",
"Modifying tree quota: '%s' with params: '%s'",
tree_quota_id, tree_quota_params
)
return self.client.request(
constants.PATCH,
Expand All @@ -2582,7 +2602,8 @@ def update_user_quota(self, user_quota_id, user_quota_params):
:rtype: None
"""
LOG.info(
f"Modifying user quota: '{user_quota_id}' with params: '{user_quota_params}'",
"Modifying user quota: '%s' with params: '%s'",
user_quota_id, user_quota_params
)
return self.client.request(
constants.PATCH,
Expand Down Expand Up @@ -2640,7 +2661,8 @@ def get_file_ads(self, filter_dict=None, all_pages=False):
:rtype: list of dict
"""
LOG.info(
f"Getting active directories with filter: '{filter_dict}' and all_pages: {all_pages}",
"Getting active directories with filter: '%s' and all_pages: %s",
filter_dict, all_pages
)
querystring = helpers.prepare_querystring(filter_dict)
LOG.info( "Querystring: '%s'", querystring)
Expand Down Expand Up @@ -2668,7 +2690,8 @@ def get_file_ldaps(self, filter_dict=None, all_pages=False):
:rtype: list of dict
"""
LOG.info(
f"Getting ldap with filter: '{filter_dict}' and all_pages: {all_pages}",
"Getting ldap with filter: '%s' and all_pages: %s",
filter_dict, all_pages
)
querystring = helpers.prepare_querystring(filter_dict)
LOG.info( "Querystring: '%s'", querystring)
Expand Down

0 comments on commit 0c6d4db

Please sign in to comment.