From: Alexandru Avadanii Date: Fri, 2 Mar 2018 16:36:58 +0000 (+0000) Subject: Merge "config/utils: YAML: Use C bindings if available" X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=511ba774f11a6293d9f5635c08204c775bff583a;p=pharos.git Merge "config/utils: YAML: Use C bindings if available" --- 511ba774f11a6293d9f5635c08204c775bff583a diff --cc config/utils/generate_config.py index 1387ed12,f5721c8d..f02acf5a --- a/config/utils/generate_config.py +++ b/config/utils/generate_config.py @@@ -21,13 -21,10 +21,14 @@@ from jinja2 import Environment, FileSys PARSER = argparse.ArgumentParser() PARSER.add_argument("--yaml", "-y", type=str, required=True) PARSER.add_argument("--jinja2", "-j", type=str, required=True) +PARSER.add_argument("--includesdir", "-i", type=str, action='append') ARGS = PARSER.parse_args() + LOADER = yaml.CSafeLoader if yaml.__with_libyaml__ else yaml.SafeLoader -ENV = Environment(loader=FileSystemLoader(os.path.dirname(ARGS.jinja2))) +ENV = Environment( + loader=FileSystemLoader([os.path.dirname(ARGS.jinja2)] + ARGS.includesdir), + extensions=['jinja2.ext.do'] +) gen_config_lib.load_custom_filters(ENV) # Run `eyaml decrypt` on the whole file, but only if PDF data is encrypted