From e4b2138e14a240de0c62c3cc7d6561b9c64c1569 Mon Sep 17 00:00:00 2001 From: Kenneth Giusti <kgiusti@redhat.com> Date: Mon, 27 Feb 2017 13:52:22 -0500 Subject: [PATCH] quiet a chatty debug log message move the socket read/write debug log message so it is only issued when there is an unhandled socket error --- pyngus/sockets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyngus/sockets.py b/pyngus/sockets.py index f176038..2e36376 100644 --- a/pyngus/sockets.py +++ b/pyngus/sockets.py @@ -50,7 +50,6 @@ def read_socket_input(connection, socket_obj): LOG.debug("Socket timeout exception %s", str(e)) raise # caller must handle except socket.error as e: - LOG.debug("Socket error exception %s", str(e)) err = e.errno if err in [errno.EAGAIN, errno.EWOULDBLOCK, @@ -58,6 +57,7 @@ def read_socket_input(connection, socket_obj): # try again later return 0 # otherwise, unrecoverable, caller must handle + LOG.debug("Socket error exception %s", str(e)) raise except Exception as e: # beats me... assume fatal LOG.debug("unknown socket exception %s", str(e)) @@ -97,7 +97,6 @@ def write_socket_output(connection, socket_obj): LOG.debug("Socket timeout exception %s", str(e)) raise # caller must handle except socket.error as e: - LOG.debug("Socket error exception %s", str(e)) err = e.errno if err in [errno.EAGAIN, errno.EWOULDBLOCK, @@ -105,6 +104,7 @@ def write_socket_output(connection, socket_obj): # try again later return 0 # else assume fatal let caller handle it: + LOG.debug("Socket error exception %s", str(e)) raise except Exception as e: # beats me... assume fatal LOG.debug("unknown socket exception %s", str(e))