| # SPDX-License-Identifier: Apache-2.0 |
| if sys.argv[2] == 'sample': |
| out_file = os.path.join(os.path.dirname(in_file), sys.argv[2] + ".yaml") |
| config = ConfigParser.ConfigParser() |
| config.readfp(open(sys.argv[1])) |
| for section in config.sections(): |
| for opt in config.options(section): |
| value = config.get(section, opt) |
| if value in ['false', 'true']: |
| tc[opt] = value == 'true' |
| y['sample'] = {'name': "TBD", 'description': "TBD"} |
| with open(out_file, "w") as f: |
| yaml.dump(y, f, width=50, indent=4, default_flow_style=False) |