Loading sjrpc/client/simple.py +3 −3 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ class SimpleRpcClient(ConnectionManager): self._connection.receive() except socket.error as err: logging.error('Socket error while receiving from the client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s', fd, err) self.shutdown() if event & select.EPOLLOUT: Loading @@ -93,11 +93,11 @@ class SimpleRpcClient(ConnectionManager): self._connection.send() except socket.error as err: logging.error('Socket error while sending to the client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s', fd, err) self.shutdown() if event & select.EPOLLHUP: logging.error('Socket HUP fd/%s' % fd) logging.error('Socket HUP fd/%s', fd) self.shutdown() #TODO def all_connections(self): Loading sjrpc/core/rpcconnection.py +5 −5 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ class RpcConnection(object): payload = self._inbound_buffer.pull(self._cur_msg_size) self._cur_msg_size = None message = json.loads(payload) logging.debug('Received: %s' % message) logging.debug('Received: %s', message) self.dispatch(message) return True Loading @@ -164,7 +164,7 @@ class RpcConnection(object): Message must be a jsonisable structure. ''' logging.debug('Sending: %s' % message) logging.debug('Sending: %s', message) json_msg = json.dumps(message) size = struct.pack('!L', len(json_msg)) with self._outbound_buffer: Loading Loading @@ -224,7 +224,7 @@ class RpcConnection(object): self._send_response(msg_id, returned=returned) def error(self, msg_id, error, message): def error(self, msg_id, error, message, traceback=None): ''' Send an error response to the peer. Loading Loading @@ -363,7 +363,7 @@ class RpcConnection(object): # manager while cleanup. else: logging.warning('Malformed message received: %s' % message) logging.warning('Malformed message received: %s', message) def shutdown(self, callback=None): ''' Loading Loading @@ -401,7 +401,7 @@ class RpcConnection(object): callback(self) except Exception as err: logging.error('Error while execution of shutdown ' 'callback: %s' % err) 'callback: %s', err) def clean_call(self, msg_id): ''' Loading sjrpc/server/simple.py +6 −6 Original line number Diff line number Diff line Loading @@ -79,11 +79,11 @@ class SimpleRpcServer(ConnectionManager): connection.receive() except socket.error as err: logging.error('Socket error while receiving from client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s', fd, err) self.shutdown_client(fd) except Exception as err: logging.error('Unknown error while receiving from client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s', fd, err) self.shutdown_client(fd) if event & select.EPOLLOUT: Loading @@ -92,15 +92,15 @@ class SimpleRpcServer(ConnectionManager): connection.send() except socket.error as err: logging.error('Socket error while sending to the client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s', fd, err) self.shutdown_client(fd) except Exception as err: logging.error('Unknown error while sending to the client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s', fd, err) self.shutdown_client(fd) if event & select.EPOLLHUP: logging.error('Socket HUP fd/%s' % fd) logging.error('Socket HUP fd/%s', fd) self.shutdown_client(fd) Loading Loading @@ -129,6 +129,6 @@ class SimpleSslRpcServer(SimpleRpcServer): ssl_version=ssl.PROTOCOL_TLSv1, do_handshake_on_connect=True) except ssl.SSLError as err: logging.error('Error when accepting ssl connection: %s' % err) logging.error('Error when accepting ssl connection: %s', err) else: return sslsock, address Loading
sjrpc/client/simple.py +3 −3 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ class SimpleRpcClient(ConnectionManager): self._connection.receive() except socket.error as err: logging.error('Socket error while receiving from the client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s', fd, err) self.shutdown() if event & select.EPOLLOUT: Loading @@ -93,11 +93,11 @@ class SimpleRpcClient(ConnectionManager): self._connection.send() except socket.error as err: logging.error('Socket error while sending to the client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s', fd, err) self.shutdown() if event & select.EPOLLHUP: logging.error('Socket HUP fd/%s' % fd) logging.error('Socket HUP fd/%s', fd) self.shutdown() #TODO def all_connections(self): Loading
sjrpc/core/rpcconnection.py +5 −5 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ class RpcConnection(object): payload = self._inbound_buffer.pull(self._cur_msg_size) self._cur_msg_size = None message = json.loads(payload) logging.debug('Received: %s' % message) logging.debug('Received: %s', message) self.dispatch(message) return True Loading @@ -164,7 +164,7 @@ class RpcConnection(object): Message must be a jsonisable structure. ''' logging.debug('Sending: %s' % message) logging.debug('Sending: %s', message) json_msg = json.dumps(message) size = struct.pack('!L', len(json_msg)) with self._outbound_buffer: Loading Loading @@ -224,7 +224,7 @@ class RpcConnection(object): self._send_response(msg_id, returned=returned) def error(self, msg_id, error, message): def error(self, msg_id, error, message, traceback=None): ''' Send an error response to the peer. Loading Loading @@ -363,7 +363,7 @@ class RpcConnection(object): # manager while cleanup. else: logging.warning('Malformed message received: %s' % message) logging.warning('Malformed message received: %s', message) def shutdown(self, callback=None): ''' Loading Loading @@ -401,7 +401,7 @@ class RpcConnection(object): callback(self) except Exception as err: logging.error('Error while execution of shutdown ' 'callback: %s' % err) 'callback: %s', err) def clean_call(self, msg_id): ''' Loading
sjrpc/server/simple.py +6 −6 Original line number Diff line number Diff line Loading @@ -79,11 +79,11 @@ class SimpleRpcServer(ConnectionManager): connection.receive() except socket.error as err: logging.error('Socket error while receiving from client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s', fd, err) self.shutdown_client(fd) except Exception as err: logging.error('Unknown error while receiving from client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s', fd, err) self.shutdown_client(fd) if event & select.EPOLLOUT: Loading @@ -92,15 +92,15 @@ class SimpleRpcServer(ConnectionManager): connection.send() except socket.error as err: logging.error('Socket error while sending to the client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s', fd, err) self.shutdown_client(fd) except Exception as err: logging.error('Unknown error while sending to the client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s', fd, err) self.shutdown_client(fd) if event & select.EPOLLHUP: logging.error('Socket HUP fd/%s' % fd) logging.error('Socket HUP fd/%s', fd) self.shutdown_client(fd) Loading Loading @@ -129,6 +129,6 @@ class SimpleSslRpcServer(SimpleRpcServer): ssl_version=ssl.PROTOCOL_TLSv1, do_handshake_on_connect=True) except ssl.SSLError as err: logging.error('Error when accepting ssl connection: %s' % err) logging.error('Error when accepting ssl connection: %s', err) else: return sslsock, address