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

Fixing failure for support_assist_settings in info module #135

Merged
merged 5 commits into from
Nov 20, 2024
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
5 changes: 2 additions & 3 deletions plugins/modules/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
'writable_snapshots', 'smb_files'.
- The parameter I(smb_files) would return for all the clusters.
- When I(gather_subset) is C(smb_files), it is assumed that the credentials of all node is same as the I(hostname).
- C(support_assist_settings) is supported for One FS version 9.5.0 and above.
'''

EXAMPLES = r'''
Expand Down Expand Up @@ -3957,9 +3958,7 @@ def get_support_assist_settings(self):
if self.major > 9 or (self.major == 9 and self.minor > 4):
return SupportAssist(self.support_assist_api, self.module).get_support_assist_settings()
else:
error_msg = "support_assist_settings is supported for One FS version 9.5.0 and above."
LOG.error(error_msg)
self.module.fail_json(msg=error_msg)
return {}

def perform_module_operation(self):
"""Perform different actions on Gatherfacts based on user parameter chosen in playbook"""
Expand Down
11 changes: 0 additions & 11 deletions tests/unit/plugins/modules/test_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,17 +571,6 @@ def test_get_facts_support_assist_api_exception(self, gatherfacts_module_mock, g
assert MockGatherfactsApi.get_gather_facts_error_response(
gather_subset) == gatherfacts_module_mock.module.fail_json.call_args[1]['msg']

@pytest.mark.parametrize("gather_subset", [
"support_assist_settings"
]
)
def test_get_facts_supportassist_exception(self, gatherfacts_module_mock, gather_subset):
"""Test the get_facts that uses the support assist api endpoint to get the exception"""
gatherfacts_module_mock.major = 8
gatherfacts_module_mock.minor = 4
gatherfacts_module_mock.get_support_assist_settings()
assert "support_assist_settings is supported for One FS version 9.5.0 and above" in gatherfacts_module_mock.module.fail_json.call_args[1]['msg']

@pytest.mark.parametrize("input_params", [
{"gather_subset": "alert_settings", "return_key": "alert_settings"}
]
Expand Down
Loading