From 0104a209bf550e8e19fc9f6142ff759067026b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Tue, 4 Jun 2019 13:59:32 +0200 Subject: [PATCH] Comply TFW lib changes --- controller/opt/server.py | 2 +- solvable/src/event_handler_main.py | 11 +++++------ solvable/src/pipe_io_main.py | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/controller/opt/server.py b/controller/opt/server.py index 175d738..9e211c5 100644 --- a/controller/opt/server.py +++ b/controller/opt/server.py @@ -4,7 +4,7 @@ import json from tornado.ioloop import IOLoop from tornado.web import RequestHandler, Application -from tfw.event_handler_base import FSMAwareEventHandler +from tfw.event_handlers import FSMAwareEventHandler class ControllerPostHandler(RequestHandler): diff --git a/solvable/src/event_handler_main.py b/solvable/src/event_handler_main.py index 71652ab..1e9ea96 100644 --- a/solvable/src/event_handler_main.py +++ b/solvable/src/event_handler_main.py @@ -5,13 +5,12 @@ from signal import signal, SIGTERM, SIGINT from tornado.ioloop import IOLoop from tfw.fsm import YamlFSM -from tfw.event_handler_base import EventHandlerBase, FSMAwareEventHandler +from tfw.event_handlers import EventHandlerBase, FSMAwareEventHandler, TFWServerUplinkConnector from tfw.components import IdeEventHandler, TerminalEventHandler from tfw.components import ProcessManagingEventHandler, BashMonitor from tfw.components import TerminalCommands, LogMonitoringEventHandler from tfw.components import FSMManagingEventHandler, DirectorySnapshottingEventHandler -from tfw.components import FrontendEventHandler -from tfw.networking import MessageSender, TFWServerConnector +from tfw.components import FrontendEventHandler, MessageSender from tfw.config import TFWENV from tfw.config.logs import logging from tao.config import TAOENV @@ -45,7 +44,7 @@ class TestCommands(TerminalCommands): """ if not args: message_template = """'{"key": "", "data": {"command": ""}}'""" - TFWServerConnector().send_message({ + TFWServerUplinkConnector().send_message({ 'key': 'shell', 'data': { 'command': 'write', @@ -53,7 +52,7 @@ class TestCommands(TerminalCommands): } }) else: - TFWServerConnector().send_message(literal_eval(args[0])) + TFWServerUplinkConnector().send_message(literal_eval(args[0])) def command_seppuku_tfw(self, *args): """ @@ -65,7 +64,7 @@ class TestCommands(TerminalCommands): 'nohup sh -c "supervisorctl restart tfwserver event_handler_main" &> /dev/null & ' 'clear && echo "Committed seppuku! :)" && sleep infinity' ) - uplink = TFWServerConnector() + uplink = TFWServerUplinkConnector() uplink.send_message({ 'key': 'shell', 'data': { diff --git a/solvable/src/pipe_io_main.py b/solvable/src/pipe_io_main.py index c81787e..d750d5b 100644 --- a/solvable/src/pipe_io_main.py +++ b/solvable/src/pipe_io_main.py @@ -2,7 +2,7 @@ from signal import signal, SIGTERM, SIGINT from tornado.ioloop import IOLoop -from tfw.event_handler_base import EventHandlerBase +from tfw.event_handlers import EventHandlerBase from tfw.components import PipeIOEventHandler