Commit d412bc72 by James Cammarata

Fall back to paramiko if the smart detection fails to run ssh

Fixes #11695
parent dfcf6a20
...@@ -407,9 +407,12 @@ class TaskExecutor: ...@@ -407,9 +407,12 @@ class TaskExecutor:
conn_type = "paramiko" conn_type = "paramiko"
else: else:
# see if SSH can support ControlPersist if not use paramiko # see if SSH can support ControlPersist if not use paramiko
cmd = subprocess.Popen(['ssh','-o','ControlPersist'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) try:
(out, err) = cmd.communicate() cmd = subprocess.Popen(['ssh','-o','ControlPersist'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if "Bad configuration option" in err: (out, err) = cmd.communicate()
if "Bad configuration option" in err:
conn_type = "paramiko"
except OSError:
conn_type = "paramiko" conn_type = "paramiko"
connection = connection_loader.get(conn_type, self._play_context, self._new_stdin) connection = connection_loader.get(conn_type, self._play_context, self._new_stdin)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment