Create mappings for System Indicator LED
Add mappings and constants for the Indicator LED value in the System class. Change-Id: I5ecad5d81a6ca1487fab2002d2bc8b57736ab4ef
This commit is contained in:
parent
fc012cb706
commit
0b9497dfa6
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
Adds mappings and constants for possible values of the Indicator LED
|
||||
value in the System class.
|
|
@ -44,6 +44,20 @@ SYSTEM_POWER_STATE_POWERING_OFF = 'powering off'
|
|||
"""A temporary state between On and Off. The power off action can take
|
||||
time while the OS is in the shutdown process"""
|
||||
|
||||
# Indicator LED Constants
|
||||
|
||||
SYSTEM_INDICATOR_LED_LIT = 'Lit'
|
||||
"""The Indicator LED is lit"""
|
||||
|
||||
SYSTEM_INDICATOR_LED_BLINKING = 'Blinking'
|
||||
"""The Indicator LED is blinking"""
|
||||
|
||||
SYSTEM_INDICATOR_LED_OFF = 'Off'
|
||||
"""The Indicator LED is off"""
|
||||
|
||||
SYSTEM_INDICATOR_LED_UNKNOWN = 'Unknown'
|
||||
"""The state of the Indicator LED cannot be determine"""
|
||||
|
||||
# Boot source target constants
|
||||
|
||||
BOOT_SOURCE_TARGET_NONE = 'none'
|
||||
|
|
|
@ -39,6 +39,13 @@ SYSTEM_POWER_STATE_MAP = {
|
|||
|
||||
SYSTEM_POWER_STATE_MAP_REV = utils.revert_dictionary(SYSTEM_POWER_STATE_MAP)
|
||||
|
||||
SYSTEM_INDICATOR_LED_MAP = {
|
||||
'Lit': sys_cons.SYSTEM_INDICATOR_LED_LIT,
|
||||
'Blinking': sys_cons.SYSTEM_INDICATOR_LED_BLINKING,
|
||||
'Off': sys_cons.SYSTEM_INDICATOR_LED_OFF,
|
||||
'Unknown': sys_cons.SYSTEM_INDICATOR_LED_UNKNOWN,
|
||||
}
|
||||
|
||||
BOOT_SOURCE_TARGET_MAP = {
|
||||
'None': sys_cons.BOOT_SOURCE_TARGET_NONE,
|
||||
'Pxe': sys_cons.BOOT_SOURCE_TARGET_PXE,
|
||||
|
|
|
@ -88,8 +88,8 @@ class System(base.ResourceBase):
|
|||
identity = base.Field('Id', required=True)
|
||||
"""The system identity string"""
|
||||
|
||||
# TODO(lucasagomes): Create mappings for the indicator_led
|
||||
indicator_led = base.Field('IndicatorLED')
|
||||
indicator_led = base.MappedField('IndicatorLED',
|
||||
sys_maps.SYSTEM_INDICATOR_LED_MAP)
|
||||
"""Whether the indicator LED is lit or off"""
|
||||
|
||||
manufacturer = base.Field('Manufacturer')
|
||||
|
|
|
@ -47,7 +47,8 @@ class SystemTestCase(base.TestCase):
|
|||
self.assertEqual('Web Front End node', self.sys_inst.description)
|
||||
self.assertEqual('web483', self.sys_inst.hostname)
|
||||
self.assertEqual('437XR1138R2', self.sys_inst.identity)
|
||||
self.assertEqual('Off', self.sys_inst.indicator_led)
|
||||
self.assertEqual(sushy.SYSTEM_INDICATOR_LED_OFF,
|
||||
self.sys_inst.indicator_led)
|
||||
self.assertEqual('Contoso', self.sys_inst.manufacturer)
|
||||
self.assertEqual('WebFrontEnd483', self.sys_inst.name)
|
||||
self.assertEqual('224071-J23', self.sys_inst.part_number)
|
||||
|
|
Loading…
Reference in New Issue