From 32bb6f895c993e174799597de368bd9300aa62b3 Mon Sep 17 00:00:00 2001 From: Vishwanatha Subbanna Date: Mon, 27 Mar 2017 18:15:52 +0530 Subject: 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 --- parse_led.py | 6 ++++-- 1 file 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::') -- cgit v1.2.1