Merge "Expose hardware model, manufacturer and system UUID via Redfish sensors"

This commit is contained in:
Zuul
2025-09-22 22:13:31 +00:00
committed by Gerrit Code Review
3 changed files with 22 additions and 2 deletions

View File

@@ -648,6 +648,14 @@ class RedfishManagement(base.ManagementInterface):
system = redfish_utils.get_system(node)
baremetal_fields = {
'Manufacturer': system.manufacturer,
'Model': system.model,
'UUID': system.uuid
}
sensors['Extra'] = baremetal_fields
for chassis in system.chassis:
try:
sensors['Fan'].update(self._get_sensors_fan(chassis))
@@ -681,7 +689,6 @@ class RedfishManagement(base.ManagementInterface):
LOG.debug("Failed reading drive information for node "
"%(node)s: %(error)s", {'node': node.uuid,
'error': exc})
LOG.debug("Gathered sensor data: %(sensors)s", {'sensors': sensors})
return sensors

View File

@@ -2032,6 +2032,9 @@ class SensorDataTestCase(db_base.DbTestCase):
def test_get_sensors_data(self, mock_system):
mock_chassis = mock.MagicMock()
mock_system.return_value.chassis = [mock_chassis]
mock_system.return_value.manufacturer = 'Test Manufacturer'
mock_system.return_value.model = 'Test Model'
mock_system.return_value.uuid = 'test-uuid-ffff'
with task_manager.acquire(self.context, self.node.uuid,
shared=True) as task:
@@ -2041,7 +2044,12 @@ class SensorDataTestCase(db_base.DbTestCase):
'Fan': {},
'Temperature': {},
'Power': {},
'Drive': {}
'Drive': {},
'Extra': {
'Manufacturer': 'Test Manufacturer',
'Model': 'Test Model',
'UUID': 'test-uuid-ffff'
}
}
self.assertEqual(expected, sensors)

View File

@@ -0,0 +1,5 @@
---
features:
- |
Adds manufacturer, model and system UUID information to the ``redfish``
sensor data collector.