Fix wrong identifier field in storage_pool
The identifier field in storage_pool should be dict object, not list according to the spec, so use base.CompositeField to parse it. Change-Id: I5bf9e4291e8909e6077ae7cd37be166b5806aa1c
This commit is contained in:
parent
d7d1eab1ab
commit
af2a2fa9e8
@ -49,7 +49,7 @@ class CapacitySourcesField(base.ListField):
|
||||
provided_capacity = CapacityField('ProvidedCapacity')
|
||||
|
||||
|
||||
class IdentifiersField(base.ListField):
|
||||
class IdentifierField(base.CompositeField):
|
||||
durable_name = base.Field('DurableName')
|
||||
durable_name_format = base.Field('DurableNameFormat')
|
||||
|
||||
@ -74,7 +74,7 @@ class StoragePool(base.ResourceBase):
|
||||
capacity_sources = CapacitySourcesField('CapacitySources')
|
||||
"""The storage pool capacity source info"""
|
||||
|
||||
identifiers = IdentifiersField('Identifier')
|
||||
identifier = IdentifierField('Identifier')
|
||||
"""These identifiers list of this volume"""
|
||||
|
||||
_allocated_volumes = None # ref to allocated volumes collection
|
||||
|
@ -5,6 +5,10 @@
|
||||
"Description": "Base storage pool",
|
||||
"Id": "2",
|
||||
"Name": "BasePool",
|
||||
"Identifier" : {
|
||||
"DurableName" : "/dev/nvme5",
|
||||
"DurableNameFormat" : "SystemPath"
|
||||
},
|
||||
"AllocatedVolumes": {
|
||||
"@odata.id": "/redfish/v1/StorageServices/NVMeoE1/StoragePools/2/AllocatedVolumes"
|
||||
},
|
||||
|
@ -46,6 +46,11 @@ class StoragePoolTestCase(testtools.TestCase):
|
||||
self.assertEqual('Enabled', self.storage_pool_inst.status.state)
|
||||
self.assertEqual('OK', self.storage_pool_inst.status.health)
|
||||
self.assertEqual('OK', self.storage_pool_inst.status.health_rollup)
|
||||
self.assertEqual(
|
||||
'/dev/nvme5', self.storage_pool_inst.identifier.durable_name)
|
||||
self.assertEqual(
|
||||
'SystemPath',
|
||||
self.storage_pool_inst.identifier.durable_name_format)
|
||||
self.assertEqual(512174850048,
|
||||
self.storage_pool_inst.capacity.allocated_bytes)
|
||||
self.assertEqual(3071983104,
|
||||
|
Loading…
x
Reference in New Issue
Block a user