Add revision for drive resource

Adds ``Revision`` property to the ``Drive`` resource.

Change-Id: Ife9e09994fc74393e551ad5cd6ab362ba890e126
Signed-off-by: Manuel Schönlaub <manuel.schoenlaub@gmail.com>
This commit is contained in:
Manuel Schönlaub 2021-10-06 15:14:51 +02:00
parent 933b8899db
commit 5b62aae362
3 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1,4 @@
---
features:
- |
Adds the ``Revision`` property to the ``Drive`` resource.

View File

@ -62,6 +62,9 @@ class Drive(base.ResourceBase):
protocol = base.MappedField('Protocol', res_maps.PROTOCOL_TYPE_VALUE_MAP)
"""Protocol this drive is using to communicate to the storage controller"""
revision = base.Field("Revision")
"""The firmware/hardware version of the drive."""
serial_number = base.Field('SerialNumber')
"""The serial number for this drive"""

View File

@ -55,6 +55,7 @@ class DriveTestCase(base.TestCase):
self.assertEqual('C123-1111', self.stor_drive.part_number)
self.assertEqual(sushy.PROTOCOL_TYPE_SAS, self.stor_drive.protocol)
self.assertEqual('1234570', self.stor_drive.serial_number)
self.assertEqual('100A', self.stor_drive.revision)
self.assertEqual(sushy.STATE_ENABLED, self.stor_drive.status.state)
self.assertEqual(sushy.HEALTH_OK, self.stor_drive.status.health)