aboutsummaryrefslogtreecommitdiffstats
path: root/utils/generate_config.py
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-09-16 02:49:41 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-09-16 03:04:43 +0200
commit6b2e09a86374d7d7b884f4ff04e78fd3d10391e6 (patch)
tree739b32af183fea2e420198746fe57e4b6b381a6e /utils/generate_config.py
parent8a369aabb95ec002dfd49024f4f028faaf4d1e42 (diff)
generate_config: Replace print statement with fc
Fix py3 compatibility by using 'print' function instead. While at it, fix constant names reported by `pylint` as invalid. Change-Id: I73e3a370560c038a8814db9758b13026dc4c0b42 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'utils/generate_config.py')
-rwxr-xr-xutils/generate_config.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/utils/generate_config.py b/utils/generate_config.py
index 523a7a8..b65bf7f 100755
--- a/utils/generate_config.py
+++ b/utils/generate_config.py
@@ -4,20 +4,20 @@ import argparse
import yaml
from jinja2 import Environment, FileSystemLoader
-parser = argparse.ArgumentParser()
-parser.add_argument("--yaml", "-y", type=str, required=True)
-parser.add_argument("--jinja2", "-j", type=str, required=True)
-args = parser.parse_args()
+PARSER = argparse.ArgumentParser()
+PARSER.add_argument("--yaml", "-y", type=str, required=True)
+PARSER.add_argument("--jinja2", "-j", type=str, required=True)
+ARGS = PARSER.parse_args()
ENV = Environment(loader=FileSystemLoader('./'))
-with open(args.yaml) as _:
- dict = yaml.safe_load(_)
+with open(ARGS.yaml) as _:
+ DICT = yaml.safe_load(_)
# Print dictionary generated from yaml (uncomment for debug)
-#print dict
+#print DICT
# Render template and print generated conf to console
-template = ENV.get_template(args.jinja2)
-print template.render(conf=dict)
+TEMPLATE = ENV.get_template(ARGS.jinja2)
+print(TEMPLATE.render(conf=DICT))