Improve error message when ssh client is not found on the host (#70122)
* Add changlelog
This commit is contained in:
parent
e396715d7b
commit
70bb2b33ca
2 changed files with 13 additions and 6 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- SSH plugin - Improve error message when ssh client is not found on the host
|
|
@ -818,12 +818,17 @@ class Connection(ConnectionBase):
|
|||
p = None
|
||||
|
||||
if not p:
|
||||
if PY3 and conn_password:
|
||||
# pylint: disable=unexpected-keyword-arg
|
||||
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, pass_fds=self.sshpass_pipe)
|
||||
else:
|
||||
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
stdin = p.stdin
|
||||
try:
|
||||
if PY3 and conn_password:
|
||||
# pylint: disable=unexpected-keyword-arg
|
||||
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, pass_fds=self.sshpass_pipe)
|
||||
else:
|
||||
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
stdin = p.stdin
|
||||
except (OSError, IOError) as e:
|
||||
raise AnsibleError('Unable to execute ssh command line on a controller due to: %s' % to_native(e))
|
||||
|
||||
# If we are using SSH password authentication, write the password into
|
||||
# the pipe we opened in _build_command.
|
||||
|
|
Loading…
Reference in a new issue