From e71857fbdf465f19403741cce3dbed4c7edd7818 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 19 Mar 2014 16:08:35 -0400 Subject: [PATCH] Addresses #6579 Only strip vault passwords if given --- lib/ansible/utils/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ansible/utils/__init__.py b/lib/ansible/utils/__init__.py index e53697cc4c..f269b5c41e 100644 --- a/lib/ansible/utils/__init__.py +++ b/lib/ansible/utils/__init__.py @@ -811,8 +811,10 @@ def ask_vault_passwords(ask_vault_pass=False, ask_new_vault_pass=False, confirm_ raise errors.AnsibleError("Passwords do not match") # enforce no newline chars at the end of passwords - vault_pass = vault_pass.strip() - new_vault_pass = new_vault_pass.strip() + if vault_pass: + vault_pass = vault_pass.strip() + if new_vault_pass: + new_vault_pass = new_vault_pass.strip() return vault_pass, new_vault_pass