Added option to change ssh executable path (#17377)

This commit is contained in:
Andrea Tartaglia 2016-09-07 16:41:43 +01:00 committed by Toshio Kuratomi
parent 07e713e7c6
commit dd71469bb7
3 changed files with 10 additions and 5 deletions

View file

@ -667,7 +667,8 @@ class TaskExecutor:
else:
# see if SSH can support ControlPersist if not use paramiko
try:
cmd = subprocess.Popen(['ssh','-o','ControlPersist'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
ssh_executable = C.ANSIBLE_SSH_EXECUTABLE
cmd = subprocess.Popen([ssh_executable, '-o', 'ControlPersist'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(out, err) = cmd.communicate()
err = to_text(err)
if u"Bad configuration option" in err or u"Usage:" in err: