|
|
@ -174,9 +174,7 @@ class Connection(ConnectionBase):
|
|
|
|
# fail early if the become password is wrong
|
|
|
|
# fail early if the become password is wrong
|
|
|
|
if self._connection_info.become and sudoable:
|
|
|
|
if self._connection_info.become and sudoable:
|
|
|
|
if self._connection_info.become_pass:
|
|
|
|
if self._connection_info.become_pass:
|
|
|
|
if self.check_incorrect_password(stdout, prompt):
|
|
|
|
self.check_incorrect_password(stdout, prompt)
|
|
|
|
raise AnsibleError('Incorrect %s password', self._connection_info.become_method)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif self.check_password_prompt(stdout, prompt):
|
|
|
|
elif self.check_password_prompt(stdout, prompt):
|
|
|
|
raise AnsibleError('Missing %s password', self._connection_info.become_method)
|
|
|
|
raise AnsibleError('Missing %s password', self._connection_info.become_method)
|
|
|
|
|
|
|
|
|
|
|
@ -333,8 +331,7 @@ class Connection(ConnectionBase):
|
|
|
|
raise AnsibleError('ssh connection closed waiting for privilege escalation password prompt')
|
|
|
|
raise AnsibleError('ssh connection closed waiting for privilege escalation password prompt')
|
|
|
|
become_errput += chunk
|
|
|
|
become_errput += chunk
|
|
|
|
|
|
|
|
|
|
|
|
if self.check_incorrect_password(become_errput, prompt):
|
|
|
|
self.check_incorrect_password(become_errput, prompt)
|
|
|
|
raise AnsibleError('Incorrect %s password', self._connection_info.become_method)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if p.stdout in rfd:
|
|
|
|
if p.stdout in rfd:
|
|
|
|
chunk = p.stdout.read()
|
|
|
|
chunk = p.stdout.read()
|
|
|
|