diff --git a/plugins/modules/filesystem.py b/plugins/modules/filesystem.py index 0247160..f961601 100644 --- a/plugins/modules/filesystem.py +++ b/plugins/modules/filesystem.py @@ -626,8 +626,8 @@ def get_filesystem(self, path): try: resp = self.namespace_api.get_directory_metadata( path, - metadata=True) - return resp.to_dict() + metadata=True).to_dict() + return resp except utils.ApiException as e: if str(e.status) == "404": log_msg = "Filesystem {0} status is " \ @@ -643,12 +643,6 @@ def get_filesystem(self, path): LOG.error(error_message) self.module.fail_json(msg=error_message) - except Exception as e: - error_message = "Failed to get details of Filesystem {0} with" \ - " error {1} ".format(path, str(e)) - LOG.error(error_message) - self.module.fail_json(msg=error_message) - def get_acl(self, effective_path): """Retrieves ACL rights of filesystem""" try: @@ -687,7 +681,6 @@ def determine_path(self): if self.module.params['path']: path = self.module.params['path'] access_zone = self.module.params['access_zone'] - if access_zone.lower() != 'system' and path: path = self.get_zone_base_path(access_zone) + path @@ -752,7 +745,7 @@ def get_group_info(self, group): self.get_group_id( name=group['name'], zone=self.module.params['access_zone'], - provider=group_provider)['groups'][0]['gid']['id'] + provider=group_provider)['groups'][0]['sid']['id'] create_group = {'type': 'group', 'id': group_id, 'name': group['name']} @@ -767,7 +760,6 @@ def create_filesystem(self, path, recursive, acl, acl_rights, quota, owner, grou create_group = None if group: create_group = self.get_group_info(group=group) - info_message = "Attempting to create new FS {0}".format(path) LOG.info(info_message) if not self.module.check_mode: @@ -1262,11 +1254,11 @@ def get_trustee_id(self, trustee_name, type, access_zone, provider): if type == 'user': return self.get_owner_id(name=trustee_name, zone=access_zone, - provider=provider)['users'][0]['uid']['id'] + provider=provider)['users'][0]['sid']['id'] elif type == 'group': return self.get_group_id(name=trustee_name, zone=access_zone, - provider=provider)['groups'][0]['gid']['id'] + provider=provider)['groups'][0]['sid']['id'] else: return self.get_wellknown_id(name=trustee_name)['wellknowns'][0]['id'] @@ -1309,7 +1301,7 @@ def get_owner_id(self, name, zone, provider): try: resp = self.auth_api.get_auth_user( auth_user_id='USER:' + name, - zone=zone, provider=provider).to_dict() + zone=zone, provider=provider.upper() + ":" + zone).to_dict() return resp except Exception as e: error_msg = self.determine_error(error_obj=e) @@ -1324,9 +1316,12 @@ def get_owner_id(self, name, zone, provider): def get_group_id(self, name, zone, provider): """Get the group account details in PowerScale""" try: + LOG.info("Getting group details here") resp = self.auth_api.get_auth_group( auth_group_id='GROUP:' + name, zone=zone, provider=provider).to_dict() + + LOG.info(resp) return resp except Exception as e: error_msg = self.determine_error(error_obj=e) @@ -1679,7 +1674,6 @@ class FilesystemHandler(): def handle(self, filesystem_obj, filesystem_params): quota = copy.deepcopy(filesystem_params['quota']) filesystem_obj.validate_input(quota) - effective_path = filesystem_obj.determine_path() filesystem_details = filesystem_obj.get_filesystem(path=effective_path) filesystem_quota = filesystem_obj.get_quota(effective_path)