|
|
@ -224,11 +224,13 @@ class Connection(ConnectionBase):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
chan.exec_command(cmd)
|
|
|
|
chan.exec_command(cmd)
|
|
|
|
if self._connection_info.prompt:
|
|
|
|
if self._connection_info.prompt:
|
|
|
|
|
|
|
|
if self._connection_info.become and self._connection_info.become_pass:
|
|
|
|
while True:
|
|
|
|
while True:
|
|
|
|
debug('Waiting for Privilege Escalation input')
|
|
|
|
debug('Waiting for Privilege Escalation input')
|
|
|
|
if self.check_become_success(become_output) or self.check_password_prompt(become_output):
|
|
|
|
if self.check_become_success(become_output) or self.check_password_prompt(become_output):
|
|
|
|
break
|
|
|
|
break
|
|
|
|
chunk = chan.recv(bufsize)
|
|
|
|
chunk = chan.recv(bufsize)
|
|
|
|
|
|
|
|
print("chunk is: %s" % chunk)
|
|
|
|
if not chunk:
|
|
|
|
if not chunk:
|
|
|
|
if 'unknown user' in become_output:
|
|
|
|
if 'unknown user' in become_output:
|
|
|
|
raise AnsibleError(
|
|
|
|
raise AnsibleError(
|
|
|
|