mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-12-23 04:31:56 +00:00
Remove TFW antipattern I wrote without thinking
This commit is contained in:
parent
2c816d5a38
commit
d11d9a70cb
@ -2,7 +2,6 @@ from functools import wraps
|
||||
|
||||
from tfw.event_handler_base import TriggerlessEventHandler
|
||||
from tfw.components.mixins import SupervisorMixin
|
||||
from tfw.networking.event_handlers.server_connector import ServerUplinkConnector
|
||||
from tfw.config.logs import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -23,7 +22,6 @@ class ProcessManagingEventHandler(TriggerlessEventHandler):
|
||||
self.key = key
|
||||
self.monitor = dirmonitor
|
||||
self.processmanager = ProcessManager()
|
||||
self.uplink = ServerUplinkConnector()
|
||||
|
||||
def _with_monitor_paused(fun):
|
||||
@wraps(fun)
|
||||
@ -39,6 +37,6 @@ class ProcessManagingEventHandler(TriggerlessEventHandler):
|
||||
try:
|
||||
data = data_json['data']
|
||||
self.processmanager(data['command'], data['process_name'])
|
||||
self.uplink.send(self.key, {'data': {'process_name': data['process_name']}})
|
||||
return data_json
|
||||
except KeyError:
|
||||
log.error('IGNORING MESSAGE: Invalid data_json received: {}'.format(data_json))
|
||||
|
Loading…
Reference in New Issue
Block a user