Backport/2.7/51898 (#52100)

* remove non-standard GetManagerAttributes, SetManagerAttributes (#51898)

(cherry picked from commit 3b20b186d7)

* add changelog fragment

* fix merge error in default Manager command

* add back {Get/Set}ManagerAttributes commands and deprecate them
This commit is contained in:
Bill Dodd 2019-03-19 17:18:25 -05:00 committed by Toshio Kuratomi
parent e8dcf0f088
commit 1d55f4a4e5
4 changed files with 16 additions and 1 deletions

View file

@ -0,0 +1,3 @@
---
bugfixes:
- "deprecate {Get/Set}ManagerAttributes commands (https://github.com/ansible/ansible/issues/47590)"

View file

@ -522,6 +522,8 @@ class RedfishUtils(object):
response = self.get_request(self.root_uri + self.manager_uri + "/" + key)
if response['ret'] is False:
if '404' in response.get('msg'):
response['msg'] = 'The GetManagerAttributes command is not supported on this Redfish service'
return response
result['ret'] = True
data = response['data']
@ -704,8 +706,10 @@ class RedfishUtils(object):
payload = {"Attributes": json.loads(manager_attr)}
response = self.patch_request(self.root_uri + self.manager_uri + "/" + attributes, payload, HEADERS)
if response['ret'] is False:
if '404' in response.get('msg'):
response['msg'] = 'The SetManagerAttributes command is not supported on this Redfish service'
return response
return {'ret': True}
return {'ret': True, 'changed': True, 'msg': "Modified Manager attribute"}
def set_bios_attributes(self, attr):
result = {}

View file

@ -223,6 +223,10 @@ def main():
for command in command_list:
if command == "SetManagerAttributes":
module.deprecate(msg='The SetManagerAttributes command in '
'module redfish_config is deprecated. '
'Use an OEM Redfish module instead.',
version='2.8')
result = rf_utils.set_manager_attributes(mgr_attributes)
# Return data back or fail with proper message

View file

@ -255,6 +255,10 @@ def main():
for command in command_list:
if command == "GetManagerAttributes":
module.deprecate(msg='The GetManagerAttributes command in '
'module redfish_facts is deprecated. '
'Use an OEM Redfish module instead.',
version='2.8')
result["manager_attributes"] = rf_utils.get_manager_attributes()
elif command == "GetLogs":
result["log"] = rf_utils.get_logs()