summaryrefslogtreecommitdiffstats
path: root/config/utils
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-01-26 21:32:07 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-01-26 21:45:10 +0100
commitafed939379a5870cbbdf3bcb4d0ce8a4ebd789a5 (patch)
treeac76187702654ba3215e8c34b33c69427b63d704 /config/utils
parentc80d5dc39aba382011ddc861bdf6d88b92678688 (diff)
generate_config: Check yaml arg is really a file
In order to support bash process substition, e.g. $ ./generate_config.py -j /path/to/template.j2 -y <(echo stuff); do not consume the contents of ARGS.yaml unless it is a file. Change-Id: I89053cfaadc158f6a15f85836892b21980081772 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'config/utils')
-rwxr-xr-xconfig/utils/generate_config.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/config/utils/generate_config.py b/config/utils/generate_config.py
index 5dbdb7d1..b2b52f0b 100755
--- a/config/utils/generate_config.py
+++ b/config/utils/generate_config.py
@@ -65,7 +65,7 @@ ENV.filters['dpkg_arch'] = dpkg_arch
# Run `eyaml decrypt` on the whole file, but only if PDF data is encrypted
# Note: eyaml return code is 0 even if keys are not available
try:
- if 'ENC[PKCS7' in open(ARGS.yaml).read():
+ if os.path.isfile(ARGS.yaml) and 'ENC[PKCS7' in open(ARGS.yaml).read():
DICT = yaml.safe_load(check_output(['eyaml', 'decrypt',
'-f', ARGS.yaml]))
except CalledProcessError as ex: