Port of d412bc7
to stable-1.9
This commit is contained in:
parent
742c6a1ffb
commit
6c3e8f214a
1 changed files with 6 additions and 3 deletions
|
@ -230,9 +230,12 @@ class Runner(object):
|
|||
self.transport = "paramiko"
|
||||
else:
|
||||
# see if SSH can support ControlPersist if not use paramiko
|
||||
cmd = subprocess.Popen(['ssh','-o','ControlPersist'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
(out, err) = cmd.communicate()
|
||||
if "Bad configuration option" in err:
|
||||
try:
|
||||
cmd = subprocess.Popen(['ssh','-o','ControlPersist'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
(out, err) = cmd.communicate()
|
||||
if "Bad configuration option" in err:
|
||||
self.transport = "paramiko"
|
||||
except OSError:
|
||||
self.transport = "paramiko"
|
||||
|
||||
# save the original transport, in case it gets
|
||||
|
|
Loading…
Reference in a new issue