diff --git a/lib/tfw/components/pipe_io_event_handler.py b/lib/tfw/components/pipe_io_event_handler.py index df3d012..d610f4f 100644 --- a/lib/tfw/components/pipe_io_event_handler.py +++ b/lib/tfw/components/pipe_io_event_handler.py @@ -9,9 +9,14 @@ LOG = logging.getLogger(__name__) class PipeIOEventHandler(EventHandlerBase): - def __init__(self, key, in_pipe_path, out_pipe_path): + def __init__(self, key, in_pipe_path, out_pipe_path, permissions=0o600): super().__init__(key) - self._pipe_io_server = JSONProxyPipeIOServer(in_pipe_path, out_pipe_path, self.server_connector.send) + self._pipe_io_server = JSONProxyPipeIOServer( + in_pipe_path, + out_pipe_path, + self.server_connector.send, + permissions + ) self._pipe_io_server.start() def cleanup(self): @@ -23,8 +28,8 @@ class PipeIOEventHandler(EventHandlerBase): class JSONProxyPipeIOServer(PipeIOServer): - def __init__(self, in_pipe_path, out_pipe_path, proxy_method): - super().__init__(in_pipe_path, out_pipe_path) + def __init__(self, in_pipe_path, out_pipe_path, proxy_method, permissions): + super().__init__(in_pipe_path, out_pipe_path, permissions) self.proxy = proxy_method def handle_message(self, message): @@ -32,4 +37,4 @@ class JSONProxyPipeIOServer(PipeIOServer): json = loads(message) self.proxy(json) except JSONDecodeError: - LOG.debug("Invalid JSON received on %s! Ignoring...", self._in_pipe) + LOG.error("Invalid JSON received on %s! Ignoring...", self._in_pipe)