Skip to content

Commit

Permalink
Fixing failure for support_assist_settings in info module (#135)
Browse files Browse the repository at this point in the history
* Fixing failure for support_assist_settings in info module

* Fixing failure for support_assist_settings in info module

* Fixing failure for support_assist_settings in info module

---------

Co-authored-by: Sachin Apagundi <[email protected]>
Co-authored-by: Bhavneet-Sharma <[email protected]>
  • Loading branch information
3 people authored Nov 20, 2024
1 parent d6a589a commit 2d269f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
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

0 comments on commit 2d269f2

Please sign in to comment.