From 569244462cfed2af208c614b5b3381e3bdca73b5 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Fri, 5 Jul 2019 21:36:43 +0000 Subject: [PATCH 1/2] [psu_base] get_status_led() returns current color of the status LED --- sonic_platform_base/fan_base.py | 9 +++++++++ sonic_platform_base/psu_base.py | 7 ++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/sonic_platform_base/fan_base.py b/sonic_platform_base/fan_base.py index 2c2411c49..fec0951ad 100644 --- a/sonic_platform_base/fan_base.py +++ b/sonic_platform_base/fan_base.py @@ -89,3 +89,12 @@ def set_status_led(self, color): bool: True if status LED state is set successfully, False if not """ raise NotImplementedError + + def get_status_led(self): + """ + Gets the state of the PSU status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + raise NotImplementedError diff --git a/sonic_platform_base/psu_base.py b/sonic_platform_base/psu_base.py index d21ca4104..00dedd7f6 100644 --- a/sonic_platform_base/psu_base.py +++ b/sonic_platform_base/psu_base.py @@ -116,14 +116,11 @@ def set_status_led(self, color): """ raise NotImplementedError - def get_status_led(self, color): + def get_status_led(self): """ Gets the state of the PSU status LED - Args: - color: A string representing the color of PSU status LED - Returns: - bool: True if get LED state returned successfully, False if not + A string, one of the predefined STATUS_LED_COLOR_* strings above """ raise NotImplementedError From fcabe0e4bbcd86b88f9968235f3d23fd213b8316 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Tue, 9 Jul 2019 18:21:21 +0000 Subject: [PATCH 2/2] Address review comments --- sonic_platform_base/fan_base.py | 3 ++- sonic_platform_base/psu_base.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sonic_platform_base/fan_base.py b/sonic_platform_base/fan_base.py index fec0951ad..7ce8c5f75 100644 --- a/sonic_platform_base/fan_base.py +++ b/sonic_platform_base/fan_base.py @@ -21,6 +21,7 @@ class FanBase(device_base.DeviceBase): # Possible fan status LED colors STATUS_LED_COLOR_GREEN = "green" + STATUS_LED_COLOR_AMBER = "amber" STATUS_LED_COLOR_RED = "red" STATUS_LED_COLOR_OFF = "off" @@ -92,7 +93,7 @@ def set_status_led(self, color): def get_status_led(self): """ - Gets the state of the PSU status LED + Gets the state of the fan status LED Returns: A string, one of the predefined STATUS_LED_COLOR_* strings above diff --git a/sonic_platform_base/psu_base.py b/sonic_platform_base/psu_base.py index 00dedd7f6..adb1a6051 100644 --- a/sonic_platform_base/psu_base.py +++ b/sonic_platform_base/psu_base.py @@ -17,6 +17,7 @@ class PsuBase(device_base.DeviceBase): # Possible fan status LED colors STATUS_LED_COLOR_GREEN = "green" + STATUS_LED_COLOR_AMBER = "amber" STATUS_LED_COLOR_RED = "red" STATUS_LED_COLOR_OFF = "off"