Fix to handle correct path for BiosRegistry

The handler for Bios/BiosRegistry doesn't match the path in
bios_attribute_registry_file.json - it shouldn't have the
identity. This is also now consistent with the actual response
returned by vendors.

Change-Id: I719f99ae400134074ca47ccb8bed7df74ccb9b45
This commit is contained in:
Bob Fournier 2021-07-16 12:32:34 -04:00
parent fad94e788e
commit 00fcd2f4f7
4 changed files with 13 additions and 7 deletions

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Fixes a bug in the handler for Bios/BiosRegistry - it should not include
identity in order to match the url returned from
bios_attribute_registry_file.json and be consistent with actual vendor
responses.

View File

@ -827,12 +827,12 @@ def message_registry_file():
'message_registry_file.json') 'message_registry_file.json')
@app.route('/redfish/v1/Systems/<identity>/Bios/BiosRegistry') @app.route('/redfish/v1/Systems/Bios/BiosRegistry')
@returns_json @returns_json
def bios_registry(identity): def bios_registry():
app.logger.debug('Serving BIOS registry') app.logger.debug('Serving BIOS registry')
return flask.render_template('bios_registry.json', identity=identity) return flask.render_template('bios_registry.json')
@app.route('/redfish/v1/Registries/Messages/Registry') @app.route('/redfish/v1/Registries/Messages/Registry')

View File

@ -1,6 +1,6 @@
{ {
"@odata.context": "/redfish/v1/$metadata#AttributeRegistry.AttributeRegistry", "@odata.context": "/redfish/v1/$metadata#AttributeRegistry.AttributeRegistry",
"@odata.id": {{ "/redfish/v1/Systems/%s/Bios/BiosRegistry"|format(identity)|tojson }}, "@odata.id": "/redfish/v1/Systems/Bios/BiosRegistry",
"@odata.type": "#AttributeRegistry.v1_1_1.AttributeRegistry", "@odata.type": "#AttributeRegistry.v1_1_1.AttributeRegistry",
"Description": "This registry defines a representation of BIOS Attribute instances", "Description": "This registry defines a representation of BIOS Attribute instances",
"Id": "BiosAttributeRegistryP89.v1_0_0", "Id": "BiosAttributeRegistryP89.v1_0_0",

View File

@ -810,10 +810,9 @@ class RegistryTestCase(EmulatorTestCase):
def test_bios_registry(self): def test_bios_registry(self):
response = self.app.get( response = self.app.get(
'/redfish/v1/Systems/%s/Bios/BiosRegistry' % self.uuid) '/redfish/v1/Systems/Bios/BiosRegistry')
self.assertEqual(200, response.status_code) self.assertEqual(200, response.status_code)
self.assertEqual('/redfish/v1/Systems/%s/Bios/BiosRegistry' self.assertEqual('/redfish/v1/Systems/Bios/BiosRegistry',
% self.uuid,
response.json['@odata.id']) response.json['@odata.id'])
self.assertEqual('BIOS Attribute Registry', self.assertEqual('BIOS Attribute Registry',
response.json['Name']) response.json['Name'])