diff options
author | James Cammarata <jimi@sngx.net> | 2015-07-22 16:19:18 -0400 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2015-07-22 16:19:18 -0400 |
commit | 6c3e8f214ad392ef79f6643ac485b83bf0e642e0 (patch) | |
tree | af18b1bc42a0b729f787160a30ac8f79d73f63ac | |
parent | 742c6a1ffb349b92ea7dd8fe0bbe50c77e4d5a78 (diff) | |
download | ansible-6c3e8f214ad392ef79f6643ac485b83bf0e642e0.tar.gz |
Port of d412bc7 to stable-1.9
-rw-r--r-- | lib/ansible/runner/__init__.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index b68928d4bb..c229e974d4 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -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 |