summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-03-30 11:21:37 +0530
committerVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-03-30 11:21:37 +0530
commitd53de6fc3b9a6542f67c572cca5326a0e23f99c6 (patch)
treedd2044a9fa5d6a3c48a432048176652c80e08de9
parent169ff8aa8801b2cc4b1582505c6f14bc268c0a11 (diff)
downloadphosphor-led-manager-d53de6fc3b9a6542f67c572cca5326a0e23f99c6.tar.gz
phosphor-led-manager-d53de6fc3b9a6542f67c572cca5326a0e23f99c6.zip
LEDS: Handle empty group
LED group consists of name and the associated LEDs that need to be actioned on when the group is asserted or de-asserted. However, its not a hard requirement that all the groups must have the associated LEDs if the system does not have the usecase. For example, it is required from the firmware standpoint that the groups "bmc_booted" and "power_on" be present but not all systems may have a mapping LED. So in those cases, the group itself can be in asserted state but without doing anything underneath. Providing this support will make sure that addition of LEDs into those groups if needed in the future are handled seamlessly. Change-Id: I345886a3edbabf11f1e9f5c9de4b9cf28a7c33f6 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
-rwxr-xr-xparse_led.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/parse_led.py b/parse_led.py
index 766a6aa..da23328 100755
--- a/parse_led.py
+++ b/parse_led.py
@@ -54,6 +54,11 @@ if __name__ == '__main__':
underscore(group) +
'\",{\n')
+ # Some LED groups could be empty
+ if not ledset:
+ ofile.write(' }},\n')
+ continue
+
for led_dict, list_dict in ledset.iteritems():
# Need this to make sure the LED name is printed once
name_printed = False
OpenPOWER on IntegriCloud