parent
4fe2d7fc8d
commit
0a2a9557b8
1 changed files with 31 additions and 25 deletions
|
@ -108,6 +108,7 @@ class CLI(object):
|
|||
vault_pass = None
|
||||
new_vault_pass = None
|
||||
|
||||
try:
|
||||
if ask_vault_pass:
|
||||
vault_pass = getpass.getpass(prompt="Vault password: ")
|
||||
|
||||
|
@ -123,6 +124,8 @@ class CLI(object):
|
|||
new_vault_pass2 = getpass.getpass(prompt="Confirm New Vault password: ")
|
||||
if new_vault_pass != new_vault_pass2:
|
||||
raise errors.AnsibleError("Passwords do not match")
|
||||
except EOFError:
|
||||
pass
|
||||
|
||||
# enforce no newline chars at the end of passwords
|
||||
if vault_pass:
|
||||
|
@ -141,6 +144,7 @@ class CLI(object):
|
|||
becomepass = None
|
||||
become_prompt = ''
|
||||
|
||||
try:
|
||||
if op.ask_pass:
|
||||
sshpass = getpass.getpass(prompt="SSH password: ")
|
||||
become_prompt = "%s password[defaults to SSH password]: " % op.become_method.upper()
|
||||
|
@ -155,6 +159,8 @@ class CLI(object):
|
|||
becomepass = sshpass
|
||||
if becomepass:
|
||||
becomepass = to_bytes(becomepass)
|
||||
except EOFError:
|
||||
pass
|
||||
|
||||
return (sshpass, becomepass)
|
||||
|
||||
|
|
Loading…
Reference in a new issue