|
|
@ -157,11 +157,16 @@ class Connection(object):
|
|
|
|
rfd, wfd, efd = select.select(rpipes, [], rpipes, 1)
|
|
|
|
rfd, wfd, efd = select.select(rpipes, [], rpipes, 1)
|
|
|
|
|
|
|
|
|
|
|
|
# fail early if the sudo/su password is wrong
|
|
|
|
# fail early if the sudo/su password is wrong
|
|
|
|
if self.runner.sudo and sudoable and self.runner.sudo_pass:
|
|
|
|
if self.runner.sudo and sudoable:
|
|
|
|
incorrect_password = gettext.dgettext(
|
|
|
|
if self.runner.sudo_pass:
|
|
|
|
"sudo", "Sorry, try again.")
|
|
|
|
incorrect_password = gettext.dgettext(
|
|
|
|
if stdout.endswith("%s\r\n%s" % (incorrect_password, prompt)):
|
|
|
|
"sudo", "Sorry, try again.")
|
|
|
|
raise errors.AnsibleError('Incorrect sudo password')
|
|
|
|
if stdout.endswith("%s\r\n%s" % (incorrect_password,
|
|
|
|
|
|
|
|
prompt)):
|
|
|
|
|
|
|
|
raise errors.AnsibleError('Incorrect sudo password')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if stdout.endswith(prompt):
|
|
|
|
|
|
|
|
raise errors.AnsibleError('Missing sudo password')
|
|
|
|
|
|
|
|
|
|
|
|
if self.runner.su and su and self.runner.su_pass:
|
|
|
|
if self.runner.su and su and self.runner.su_pass:
|
|
|
|
incorrect_password = gettext.dgettext(
|
|
|
|
incorrect_password = gettext.dgettext(
|
|
|
|