Fix --ask-vault-pass prompt to match old when poss (#27602)

If we don't use more than one vault-id, and we use
--ask-vault-pass, instead of using the new vault prompt
format ('Vault password (my_vault_id): ') we use the old
one ('Vault password: ').

This avoids confusing Tower when it needs to detect an
interactive vault password prompt.

This also potentially could allow vault password prompts
to be customized per vault_id.
This commit is contained in:
Adrian Likins 2017-08-01 16:39:54 -04:00 committed by GitHub
parent 37392318a6
commit 9f57920eab
2 changed files with 20 additions and 10 deletions

View file

@ -259,7 +259,7 @@ class PromptVaultSecret(VaultSecret):
b_vault_passwords = []
for prompt_format in self.prompt_formats:
prompt = prompt_format % self.vault_id
prompt = prompt_format % {'vault_id': self.vault_id}
try:
vault_pass = display.prompt(prompt, private=True)
except EOFError: