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>
# 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: