From d233976a15dc3945f7465477cc92f4904af34688 Mon Sep 17 00:00:00 2001 From: Christian Pinto Date: Tue, 10 Oct 2023 09:36:41 +0100 Subject: [PATCH] Fixed AggregationSource arguments mismatch --- api_emulator/redfish/EventListener_api.py | 2 +- tests/test.py | 2 +- tests/test_templates.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api_emulator/redfish/EventListener_api.py b/api_emulator/redfish/EventListener_api.py index 61a2a975..466e81eb 100644 --- a/api_emulator/redfish/EventListener_api.py +++ b/api_emulator/redfish/EventListener_api.py @@ -94,7 +94,7 @@ def AggregationSourceDiscovered(self, event): "rb": g.rest_base } aggregation_source_template = AggregationSourceTemplate.get_AggregationSource_instance(wildcards) - aggregation_source_template["HostName"] = f"{event['MessageArgs'][0]}:{event['MessageArgs'][1]}" + aggregation_source_template["HostName"] = event['MessageArgs'][1] aggregation_source_template["Name"] = f"Agent {aggregationSourceId}" aggregation_source_template["Links"] = { "ConnectionMethod" : {}, diff --git a/tests/test.py b/tests/test.py index 6ac38f4c..5b6b6898 100644 --- a/tests/test.py +++ b/tests/test.py @@ -45,7 +45,7 @@ def test_aggregation_source_creation (self): #Check Aggregtion SOurce got created with proper Id self.assertEqual(response_payload["Id"], manager_name) #Check the Hostoname:port was properly parsed - hostname = f"{test_templates.test_aggregation_source_event['Events'][0]['MessageArgs'][0]}:{test_templates.test_aggregation_source_event['Events'][0]['MessageArgs'][1]}" + hostname = test_templates.test_aggregation_source_event['Events'][0]['MessageArgs'][1] self.assertEqual(response_payload["HostName"], hostname) if __name__ == '__main__': diff --git a/tests/test_templates.py b/tests/test_templates.py index 1bbd9161..c06b4886 100644 --- a/tests/test_templates.py +++ b/tests/test_templates.py @@ -101,7 +101,7 @@ "Severity": "Ok", "Message": "New Manager Available at FQDN http://foo.bar.org and Port 1234 ", "MessageId": "Manager.1.0.AggregationSourceDiscovered", - "MessageArgs": [ "http://foo.bar.org", "1234" ], + "MessageArgs": [ "Redfish", "http://foo.bar.org:1234" ], "OriginOfCondition": { "@odata.id": "/redfish/v1/Managers/Manager1" }