From ddd46f6599ad045bed67879afa491867c94a7ae5 Mon Sep 17 00:00:00 2001 From: Mahmoud Saada Date: Sun, 21 Jun 2015 13:51:07 -0700 Subject: [PATCH] Update rekey() in vault.py to validate files passed exist before prompting for password --- lib/ansible/cli/vault.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/cli/vault.py b/lib/ansible/cli/vault.py index 05a48065771..487212e7d8c 100644 --- a/lib/ansible/cli/vault.py +++ b/lib/ansible/cli/vault.py @@ -115,6 +115,9 @@ class VaultCLI(CLI): self.display.display("Encryption successful") def execute_rekey(self): + for f in self.args: + if not (os.path.isfile(f)): + raise AnsibleError(f + " does not exist") __, new_password = self.ask_vault_passwords(ask_vault_pass=False, ask_new_vault_pass=True, confirm_new=True) for f in self.args: