diff --git a/solvable/src/pipe_io_auxlib.py b/solvable/src/pipe_io_auxlib.py index a06ce06..9b85fde 100644 --- a/solvable/src/pipe_io_auxlib.py +++ b/solvable/src/pipe_io_auxlib.py @@ -30,7 +30,7 @@ class SignMessagePipeIOEventHandler(PipeIOEventHandlerBase): message = loads(message_bytes) sign_message(self.auth_key, message) if self.forwarding: - self.server_connector.send(message) + self.server_connector.send_message(message) self.pipe_io.send_message(dumps(message).encode()) @@ -77,7 +77,7 @@ class BotPipeIOEventHandler(PipeIOEventHandlerBase): def handle_pipe_event(self, message_bytes): if message_bytes == b"": if self.queue: - self.server_connector.send({ + self.server_connector.send_message({ 'key': 'queueMessages', 'data': { 'messages': self.queue @@ -137,9 +137,9 @@ class DeployPipeIOEventHandler(PipeIOEventHandlerBase): self.expected = False if message_bytes == b'true': - self.server_connector.send(self.onsuccess) + self.server_connector.send_message(self.onsuccess) elif message_bytes == b'false': - self.server_connector.send(self.onerror) + self.server_connector.send_message(self.onerror) else: raise ValueError( f'{self.pipe_io.in_pipe}: Expected "true" or "false".' @@ -178,7 +178,7 @@ class IdePipeIOEventHandler(PipeIOEventHandlerBase): def handle_pipe_event(self, message_bytes): if not self.selected: - self.server_connector.send({ + self.server_connector.send_message({ 'key': 'mirror', 'data': { 'key': 'ide', @@ -189,7 +189,7 @@ class IdePipeIOEventHandler(PipeIOEventHandlerBase): } }) - self.server_connector.send({ + self.server_connector.send_message({ 'key': 'mirror', 'data': { 'key': 'ide', @@ -199,7 +199,7 @@ class IdePipeIOEventHandler(PipeIOEventHandlerBase): } } }) - self.server_connector.send({ + self.server_connector.send_message({ 'key': 'mirror', 'data': { 'key': 'ide', @@ -229,7 +229,7 @@ class FSMPipeIOEventHandler(PipeIOEventHandlerBase): self.pipe_io.send_message(message['data']['current_state'].encode()) def handle_pipe_event(self, message_bytes): - self.server_connector.send({ + self.server_connector.send_message({ 'key': '', 'trigger': message_bytes.decode() }) diff --git a/solvable/src/pipe_io_main.py b/solvable/src/pipe_io_main.py index b15f6a5..a1e9e9a 100644 --- a/solvable/src/pipe_io_main.py +++ b/solvable/src/pipe_io_main.py @@ -31,8 +31,7 @@ if __name__ == '__main__': json_pipe = PipeIOEventHandler( '', '/tmp/tfw_json_send', - '/tmp/tfw_json_recv', - permissions=0o666 + '/tmp/tfw_json_recv' ) sign_pipe = SignMessagePipeIOEventHandler( @@ -48,7 +47,8 @@ if __name__ == '__main__': bot_pipe = BotPipeIOEventHandler( '/tmp/tfw_bot_send', - '/tmp/tfw_bot_recv' + '/tmp/tfw_bot_recv', + permissions=0o666 ) deploy_pipe = DeployPipeIOEventHandler( diff --git a/solvable/src/webservice/user_ops.py b/solvable/src/webservice/user_ops.py index 372db7b..3517acb 100644 --- a/solvable/src/webservice/user_ops.py +++ b/solvable/src/webservice/user_ops.py @@ -11,14 +11,8 @@ class UserOps: self.username = username self.password = password self.db_session = db_session - self.pipe = PipeWriter('/tmp/tfw_json_send') - self.log = lambda message: self.pipe.send_message(dumps({ - 'key': 'message', - 'data': { - 'originator': 'Authenticator', - 'message': message - } - }).encode()) + self.pipe = PipeWriter('/tmp/tfw_bot_send') + self.log = lambda message: self.pipe.send_message(message.encode()+b"\n") def authenticate(self): """