From d53de6fc3b9a6542f67c572cca5326a0e23f99c6 Mon Sep 17 00:00:00 2001 From: Vishwanatha Subbanna Date: Thu, 30 Mar 2017 11:21:37 +0530 Subject: 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 --- parse_led.py | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit v1.2.1