LEDS: Convert group and led names to lower_case_underscore

This converts the LED group names and LED names from all formats
to lower_case_underscore.

Example : fan0IdentifyTest will become fan0_identify_test

Fixes openbmc/openbmc#1312

Change-Id: Iffa458d593239eb1cb6be0bcda749260cb01c80d
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/parse_led.py b/parse_led.py
index af81d62..766a6aa 100755
--- a/parse_led.py
+++ b/parse_led.py
@@ -2,6 +2,7 @@
 import yaml
 import os
 import argparse
+from inflection import underscore
 
 if __name__ == '__main__':
     script_dir = os.path.dirname(os.path.realpath(__file__))
@@ -50,7 +51,7 @@
             ofile.write(
                 '   {\"' +
                 "/xyz/openbmc_project/led/groups/" +
-                group +
+                underscore(group) +
                 '\",{\n')
 
             for led_dict, list_dict in ledset.iteritems():
@@ -59,7 +60,8 @@
                 for name, value in list_dict.iteritems():
                     if group and led_dict and name:
                         if name_printed is False:
-                            ofile.write('        {\"' + led_dict + '\",')
+                            ofile.write('        {\"' + underscore(led_dict) +
+                                        '\",')
                             name_printed = True
                         if name == 'Action':
                             ofile.write('phosphor::led::Layout::')