From 6c3e8f214ad392ef79f6643ac485b83bf0e642e0 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 22 Jul 2015 16:19:18 -0400 Subject: [PATCH] Port of d412bc7 to stable-1.9 --- lib/ansible/runner/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index b68928d4bbc..c229e974d4f 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