From fa332e1342ff99665504f036c82cf90f2fa04433 Mon Sep 17 00:00:00 2001 From: George Sudarkoff Date: Wed, 7 Oct 2015 10:32:50 -0700 Subject: [PATCH] Fail if the vault password script returns non-zero. --- lib/ansible/cli/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/cli/__init__.py b/lib/ansible/cli/__init__.py index bf5e33e6be..9391d386fb 100644 --- a/lib/ansible/cli/__init__.py +++ b/lib/ansible/cli/__init__.py @@ -501,6 +501,8 @@ class CLI(object): except OSError as e: raise AnsibleError("Problem running vault password script %s (%s). If this is not a script, remove the executable bit from the file." % (' '.join(this_path), e)) stdout, stderr = p.communicate() + if p.returncode != 0: + raise AnsibleError("Vault password script %s returned non-zero (%s)." % (this_path, p.returncode)) vault_pass = stdout.strip('\r\n') else: try: