Port of d412bc7 to stable-1.9

This commit is contained in:
James Cammarata 2015-07-22 16:19:18 -04:00
parent 742c6a1ffb
commit 6c3e8f214a

View file

@ -230,10 +230,13 @@ class Runner(object):
self.transport = "paramiko" self.transport = "paramiko"
else: else:
# see if SSH can support ControlPersist if not use paramiko # see if SSH can support ControlPersist if not use paramiko
try:
cmd = subprocess.Popen(['ssh','-o','ControlPersist'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) cmd = subprocess.Popen(['ssh','-o','ControlPersist'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(out, err) = cmd.communicate() (out, err) = cmd.communicate()
if "Bad configuration option" in err: if "Bad configuration option" in err:
self.transport = "paramiko" self.transport = "paramiko"
except OSError:
self.transport = "paramiko"
# save the original transport, in case it gets # save the original transport, in case it gets
# changed later via options like accelerate # changed later via options like accelerate