From 6c498599b18c25b248c839f9de56e15d71965062 Mon Sep 17 00:00:00 2001 From: Scott Seekamp <13857911+sseekamp@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:03:31 -0600 Subject: [PATCH] Update tasks to return previous behavior output for single manager node types and expanded output for multi-manager node types --- changelogs/fragments/8178-redfish-info-multi.yml | 4 ++-- plugins/module_utils/redfish_utils.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/changelogs/fragments/8178-redfish-info-multi.yml b/changelogs/fragments/8178-redfish-info-multi.yml index 3bc97909be..9d59839497 100644 --- a/changelogs/fragments/8178-redfish-info-multi.yml +++ b/changelogs/fragments/8178-redfish-info-multi.yml @@ -1,2 +1,2 @@ -breaking_changes: - - redfish_info - modify ``GetLogs`` and ``GetNetworkProtocols`` commands to support multi-manager node types. These commands will return a list of dictionaries similar to the ``GetManagerInventory`` and ``GetSystemInventory`` commands instead of a single dictionary (https://github.com/ansible-collections/community.general/issues/6764). +minor_changes: + - redfish_info - modify ``GetLogs`` and ``GetNetworkProtocols`` commands to support multi-manager node types. These commands will return a list of dictionaries similar to the ``GetManagerInventory`` and ``GetSystemInventory`` commands instead of a single dictionary when multiple managers are present, otherwise existing output is unchanged (https://github.com/ansible-collections/community.general/issues/6764). diff --git a/plugins/module_utils/redfish_utils.py b/plugins/module_utils/redfish_utils.py index 88d314ee78..6f56f559fd 100644 --- a/plugins/module_utils/redfish_utils.py +++ b/plugins/module_utils/redfish_utils.py @@ -625,7 +625,10 @@ class RedfishUtils(object): return allowable_values def get_multi_logs(self): - return self.aggregate_managers(self.get_logs) + if len(self.manager_uris) > 1: + return self.aggregate_managers(self.get_logs) + else: + return self.get_logs(self.manager_uri) def get_logs(self, manager_uri): log_svcs_uri_list = [] @@ -2987,7 +2990,10 @@ class RedfishUtils(object): return self.aggregate_systems(self.get_system_inventory) def get_multi_network_protocols(self): - return self.aggregate_managers(self.get_network_protocols) + if len(self.manager_uris) > 1: + return self.aggregate_managers(self.get_network_protocols) + else: + return self.get_network_protocols(self.manager_uri) def get_network_protocols(self, manager_uri): result = {}