From ab266472be140884a937572a9700730b23ead51d Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Tue, 28 Feb 2012 04:23:34 -0500 Subject: [PATCH] Trim errors on connection refused messages --- lib/ansible/runner.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/ansible/runner.py b/lib/ansible/runner.py index 11af92e00d..aad7553259 100755 --- a/lib/ansible/runner.py +++ b/lib/ansible/runner.py @@ -115,11 +115,9 @@ class Runner(object): ssh.connect(host, username=self.remote_user, allow_agent=True, look_for_keys=True, password=self.remote_pass) return [ True, ssh ] - except paramiko.AuthenticationException, e: - return [ False, str(e) ] - except: + except Exception, e: # it failed somehow, return the failure string - return [ False, traceback.format_exc() ] + return [ False, str(e) ] def _return_from_module(self, conn, host, result): ''' helper function to handle JSON parsing of results '''