Skip to content
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

Adding fix for ANSISILON-2017 #111

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
4 changes: 2 additions & 2 deletions plugins/module_utils/storage/dell/nwpool_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _url_common_args_spec(self, method, api_timeout, headers=None):
}
return url_kwargs

def _args_without_session(self, path, method, api_timeout, headers=None):
def _args_without_session(self, method, api_timeout, headers=None):
"""Creates an argument spec in case of basic authentication"""
req_header = self._headers
if headers:
Expand All @@ -136,7 +136,7 @@ def invoke_request(self, uri, method, data=None, query_param=None, headers=None,
if 'X-Auth-Token' in self._headers:
url_kwargs = self._args_with_session(method, api_timeout, headers=headers)
else:
url_kwargs = self._args_without_session(uri, method, api_timeout, headers=headers)
url_kwargs = self._args_without_session(method, api_timeout, headers=headers)
if data and dump:
data = json.dumps(data)
url = self._build_url(uri, query_param=query_param)
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/storage/dell/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def validate_python_version(cur_py_ver):
''' Validates threshold overhead parameter based on imported sdk version '''


def validate_threshold_overhead_parameter(quota, threshold_overhead_param):
def validate_threshold_overhead_parameter(quota):
error_msg = None
key = 'thresholds_on'
if quota and key in quota \
Expand Down
3 changes: 1 addition & 2 deletions plugins/modules/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1236,8 +1236,7 @@ def validate_input(self, quota):
'only MB, GB and TB are '
'supported.')

VALIDATE_THRESHOLD = utils.validate_threshold_overhead_parameter(
quota, "include_data_protection_overhead")
VALIDATE_THRESHOLD = utils.validate_threshold_overhead_parameter(quota)
if VALIDATE_THRESHOLD and not \
VALIDATE_THRESHOLD["param_is_valid"]:
self.module.fail_json(msg=VALIDATE_THRESHOLD["error_message"])
Expand Down
3 changes: 1 addition & 2 deletions plugins/modules/smartquota.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,7 @@ def perform_module_operation(self):
message = "Quota Dictionary after conversion: %s" % str(quota)
LOG.debug(message)

VALIDATE_THRESHOLD = utils.validate_threshold_overhead_parameter(
quota, "include_overheads")
VALIDATE_THRESHOLD = utils.validate_threshold_overhead_parameter(quota)
if VALIDATE_THRESHOLD and not VALIDATE_THRESHOLD["param_is_valid"]:
self.module.fail_json(msg=VALIDATE_THRESHOLD["error_message"])
# If Access_Zone is System then absolute path is required
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/smb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@ def validate_permission_and_runas_root(self):

def validate_input_params(self, share_name, access_zone, path):
"""Validate the user input parameters"""
if (not share_name) or utils.is_param_empty_spaces(share_name):
if (not share_name) or len(share_name) < 1 or share_name.isspace():
error_message = f"Invalid share name {share_name}"
LOG.error(error_message)
self.module.fail_json(msg=error_message)
Expand Down
1 change: 1 addition & 0 deletions tests/config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
modules:
python_requires: '>=3.9'
Loading