summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-03-27 18:15:52 +0530
committerVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-03-28 15:02:47 +0530
commit32bb6f895c993e174799597de368bd9300aa62b3 (patch)
tree19d3992f277fe296263ec911d00725c5cd547748
parentdcc3f38fb677f57167f76a8f9e7f7cf4cfbf0c45 (diff)
downloadphosphor-led-manager-32bb6f895c993e174799597de368bd9300aa62b3.zip
phosphor-led-manager-32bb6f895c993e174799597de368bd9300aa62b3.tar.gz
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>
-rwxr-xr-xparse_led.py6
1 files changed, 4 insertions, 2 deletions
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 @@ if __name__ == '__main__':
ofile.write(
' {\"' +
"/xyz/openbmc_project/led/groups/" +
- group +
+ underscore(group) +
'\",{\n')
for led_dict, list_dict in ledset.iteritems():
@@ -59,7 +60,8 @@ if __name__ == '__main__':
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::')
OpenPOWER on IntegriCloud