|
|
@ -214,14 +214,18 @@ class Runner(object):
|
|
|
|
self.run_once = run_once
|
|
|
|
self.run_once = run_once
|
|
|
|
|
|
|
|
|
|
|
|
if self.transport == 'smart':
|
|
|
|
if self.transport == 'smart':
|
|
|
|
# if the transport is 'smart' see if SSH can support ControlPersist if not use paramiko
|
|
|
|
# If the transport is 'smart', check to see if certain conditions
|
|
|
|
|
|
|
|
# would prevent us from using ssh, and fallback to paramiko.
|
|
|
|
# 'smart' is the default since 1.2.1/1.3
|
|
|
|
# 'smart' is the default since 1.2.1/1.3
|
|
|
|
|
|
|
|
self.transport = "ssh"
|
|
|
|
|
|
|
|
if sys.platform.startswith('darwin'):
|
|
|
|
|
|
|
|
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)
|
|
|
|
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"
|
|
|
|
else:
|
|
|
|
|
|
|
|
self.transport = "ssh"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|