diff options
author | Peter Sprygada <privateip@users.noreply.github.com> | 2017-03-21 09:15:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-21 09:15:23 -0700 |
commit | 4a8f2dde20f2c4afca50d582eaff9049d50c66bb (patch) | |
tree | 13704a741dc0d1efd2abe510eab91ed2ac8dcfb6 /bin/ansible-connection | |
parent | d6787632c94baf2e05edcc8377da31b6254c86a7 (diff) | |
download | ansible-4a8f2dde20f2c4afca50d582eaff9049d50c66bb.tar.gz |
fixes exception raised from ansible-connection logging (#22836)
updates ansible-connection logging functions to use display instead of
log.
Diffstat (limited to 'bin/ansible-connection')
-rwxr-xr-x | bin/ansible-connection | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/ansible-connection b/bin/ansible-connection index 3ebebe8910..89e1158ef2 100755 --- a/bin/ansible-connection +++ b/bin/ansible-connection @@ -290,10 +290,10 @@ def main(): try: server = Server(sf_path, pc) except AnsibleConnectionFailure as exc: - log(str(exc), pc.remote_addr, pc.remote_user) + display.display(str(exc), pc.remote_addr, pc.remote_user, log_only=True) rc = 1 except Exception as exc: - log(traceback.format_exc(), pc.remote_addr, pc.remote_user) + display.display(traceback.format_exc(), pc.remote_addr, pc.remote_user, log_only=True) rc = 1 fcntl.lockf(lock_fd, fcntl.LOCK_UN) os.close(lock_fd) @@ -301,7 +301,7 @@ def main(): server.run() sys.exit(rc) else: - log('re-using existing socket connection', pc.remote_addr, pc.remote_user) + display.display('re-using existing socket connection', pc.remote_addr, pc.remote_user, log_only=True) fcntl.lockf(lock_fd, fcntl.LOCK_UN) os.close(lock_fd) @@ -326,8 +326,8 @@ def main(): time.sleep(C.PERSISTENT_CONNECT_INTERVAL) attempts += 1 if attempts > C.PERSISTENT_CONNECT_RETRIES: - log('number of connection attempts exceeded, unable to connect to control socket', pc.remote_addr, pc.remote_user) - log('persistent_connect_interval=%s, persistent_connect_retries=%s' % (C.PERSISTENT_CONNECT_INTERVAL, C.PERSISTENT_CONNECT_RETRIES), pc.remote_addr, pc.remote_user) + display.display('number of connection attempts exceeded, unable to connect to control socket', pc.remote_addr, pc.remote_user, log_only=True) + display.display('persistent_connect_interval=%s, persistent_connect_retries=%s' % (C.PERSISTENT_CONNECT_INTERVAL, C.PERSISTENT_CONNECT_RETRIES), pc.remote_addr, pc.remote_user, log_only=True) sys.stderr.write('failed to connect to control socket') sys.exit(255) |