summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPeter Sprygada <privateip@users.noreply.github.com>2017-01-26 13:59:57 -0500
committerGitHub <noreply@github.com>2017-01-26 13:59:57 -0500
commitb4d75f41f56d1b06ca20040bf516ac4b5a598b65 (patch)
tree85e608ac01b82c68d8defb4bec2c4268ea763b6b /bin
parent8c3b915721dbaf1dacf70894a41423cbcfc6c414 (diff)
downloadansible-b4d75f41f56d1b06ca20040bf516ac4b5a598b65.tar.gz
one more bug fix for ansible-connection (#20707)
The connection instance will now return a meaningful error if the connection property returns False
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ansible-connection4
1 files changed, 1 insertions, 3 deletions
diff --git a/bin/ansible-connection b/bin/ansible-connection
index c198478570..5605c1a388 100755
--- a/bin/ansible-connection
+++ b/bin/ansible-connection
@@ -122,7 +122,7 @@ class Server():
self.conn = connection_loader.get(play_context.connection, play_context, sys.stdin)
self.conn._connect()
if not self.conn.connected:
- raise AnsibleConnectionFailure(err)
+ raise AnsibleConnectionFailure('unable to connect to remote host')
self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.socket.bind(path)
@@ -283,8 +283,6 @@ def main():
if pid == 0:
try:
server = Server(sf_path, pc)
- except AnsibleConnectionFailure as exc:
- log(str(exc), pc.remote_addr)
except Exception as exc:
log(traceback.format_exc(), pc.remote_addr)
fcntl.lockf(lock_fd, fcntl.LOCK_UN)