Commit 920f49f7 by Brian Coca Committed by James Cammarata

fixed issue with prompt == none and su + ask_pass in ssh plugin

parent 55a2d370
...@@ -335,7 +335,7 @@ class Connection(object): ...@@ -335,7 +335,7 @@ class Connection(object):
"sudo", "Sorry, try again.") "sudo", "Sorry, try again.")
if sudo_errput.strip().endswith("%s%s" % (prompt, incorrect_password)): if sudo_errput.strip().endswith("%s%s" % (prompt, incorrect_password)):
raise errors.AnsibleError('Incorrect sudo password') raise errors.AnsibleError('Incorrect sudo password')
elif sudo_errput.endswith(prompt): elif prompt and sudo_errput.endswith(prompt):
stdin.write(self.runner.sudo_pass + '\n') stdin.write(self.runner.sudo_pass + '\n')
if p.stdout in rfd: if p.stdout in rfd:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment