Skip to content

Commit

Permalink
Merge pull request #28 from christian-pinto/fix-agent-creation-test
Browse files Browse the repository at this point in the history
Fixed AggregationSource arguments mismatch
  • Loading branch information
mgazz committed Oct 10, 2023
2 parents 36f34bf + d233976 commit 64e778a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api_emulator/redfish/EventListener_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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" : {},
Expand Down
2 changes: 1 addition & 1 deletion tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
2 changes: 1 addition & 1 deletion tests/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit 64e778a

Please sign in to comment.