Merge "Add SKU field to Redfish inspection"

This commit is contained in:
Zuul
2025-09-23 19:35:39 +00:00
committed by Gerrit Code Review
2 changed files with 18 additions and 0 deletions

View File

@@ -158,6 +158,12 @@ class RedfishInspect(base.InspectInterface):
if system.manufacturer:
system_vendor['manufacturer'] = str(system.manufacturer)
if system.sku:
system_vendor['sku'] = str(system.sku)
if system.uuid:
system_vendor['system_uuid'] = str(system.uuid)
if system_vendor:
inventory['system_vendor'] = system_vendor

View File

@@ -139,6 +139,10 @@ class RedfishInspectTestCase(db_base.DbTestCase):
system_mock.manufacturer = 'Sushy Emulator'
system_mock.sku = 'DELL123456'
system_mock.uuid = '12345678-1234-1234-1234-12345'
return system_mock
def test_get_properties(self):
@@ -185,12 +189,18 @@ class RedfishInspectTestCase(db_base.DbTestCase):
expected_product_name = 'System1'
expected_serial_number = '123456'
expected_manufacturer = 'Sushy Emulator'
expected_sku = 'DELL123456'
expected_system_uuid = '12345678-1234-1234-1234-12345'
self.assertEqual(expected_product_name,
system_vendor['product_name'])
self.assertEqual(expected_serial_number,
system_vendor['serial_number'])
self.assertEqual(expected_manufacturer,
system_vendor['manufacturer'])
self.assertEqual(expected_sku,
system_vendor['sku'])
self.assertEqual(expected_system_uuid,
system_vendor['system_uuid'])
expected_interfaces = [{'mac_address': '00:11:22:33:44:55',
'name': 'NIC.Integrated.1-1'},
@@ -700,6 +710,8 @@ class RedfishInspectTestCase(db_base.DbTestCase):
system_mock.name = None
system_mock.serial_number = None
system_mock.manufacturer = None
system_mock.sku = None
system_mock.uuid = None
with task_manager.acquire(self.context, self.node.uuid,
shared=True) as task: