summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPeter Sprygada <privateip@users.noreply.github.com>2017-01-16 08:32:08 -0500
committerGitHub <noreply@github.com>2017-01-16 08:32:08 -0500
commit312328e22cb3c3561b3a194cf9349ead603837aa (patch)
tree312dee1b21a10301a3c81c9cc16a5e43b48a87e2 /bin
parentcc75505d14d399aee8408b025b7ce46ae9f6c55a (diff)
downloadansible-312328e22cb3c3561b3a194cf9349ead603837aa.tar.gz
adds more logging to ansible-connection (#20298)
* Server() instance will now add the entire traceback to syslog if it fail during init
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ansible-connection13
1 files changed, 4 insertions, 9 deletions
diff --git a/bin/ansible-connection b/bin/ansible-connection
index d89a590682..0d5197313d 100755
--- a/bin/ansible-connection
+++ b/bin/ansible-connection
@@ -117,19 +117,16 @@ class Server():
self._start_time = datetime.datetime.now()
- self.log('loading connection plugin %s' % str(play_context.connection))
- self.conn = connection_loader.get(play_context.connection, play_context, sys.stdin)
-
try:
- self.log('attempting to connect to remote host')
+ self.log('loading connection plugin %s' % str(play_context.connection))
+ self.conn = connection_loader.get(play_context.connection, play_context, sys.stdin)
self.conn._connect()
- self.log('successfully connected, starting listener')
self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.socket.bind(path)
self.socket.listen(1)
except Exception as exc:
- self.log(str(exc))
+ self.log(traceback.format_exc())
raise
signal.signal(signal.SIGALRM, self.alarm_handler)
@@ -223,9 +220,7 @@ class Server():
send_data(s, to_bytes(stderr))
s.close()
except Exception as e:
- # FIXME: proper logging and error handling here
- log('runtime exception: %s' % e)
- print(traceback.format_exc())
+ log(traceback.format_exc())
finally:
# when done, close the connection properly and cleanup
# the socket file so it can be recreated