From b6009a0da7d7367d3bb37bb69c1a7875fc015a01 Mon Sep 17 00:00:00 2001 From: Anish Bhatt Date: Mon, 10 Oct 2016 18:02:17 -0700 Subject: [PATCH] Fetch primary_status from raid controller This is already being polled but just not returned. This also bring parity with standard racadm output. Change-Id: Ia5f1c49b46463f4872960d2f652a7406b79101eb --- dracclient/resources/raid.py | 5 ++++- dracclient/tests/test_raid.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dracclient/resources/raid.py b/dracclient/resources/raid.py index 85c8742..96e5562 100644 --- a/dracclient/resources/raid.py +++ b/dracclient/resources/raid.py @@ -106,7 +106,7 @@ def raid_state(self): RAIDController = collections.namedtuple( 'RAIDController', ['id', 'description', 'manufacturer', 'model', - 'firmware_version']) + 'primary_status', 'firmware_version']) VirtualDiskTuple = collections.namedtuple( 'VirtualDisk', @@ -182,6 +182,9 @@ def _parse_drac_raid_controller(self, drac_controller): drac_controller, 'DeviceCardManufacturer'), model=self._get_raid_controller_attr( drac_controller, 'ProductName'), + primary_status=constants.PRIMARY_STATUS[ + self._get_raid_controller_attr(drac_controller, + 'PrimaryStatus')], firmware_version=self._get_raid_controller_attr( drac_controller, 'ControllerFirmwareVersion')) diff --git a/dracclient/tests/test_raid.py b/dracclient/tests/test_raid.py index efc25f8..05cdd5d 100644 --- a/dracclient/tests/test_raid.py +++ b/dracclient/tests/test_raid.py @@ -40,6 +40,7 @@ def test_list_raid_controllers(self, mock_requests): description='Integrated RAID Controller 1', manufacturer='DELL', model='PERC H710 Mini', + primary_status='ok', firmware_version='21.3.0-0009') mock_requests.post(