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>
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 @@
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