mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 22:51:32 +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.event_handler_base import TriggerlessEventHandler
|
||||||
from tfw.components.mixins import SupervisorMixin
|
from tfw.components.mixins import SupervisorMixin
|
||||||
from tfw.networking.event_handlers.server_connector import ServerUplinkConnector
|
|
||||||
from tfw.config.logs import logging
|
from tfw.config.logs import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -23,7 +22,6 @@ class ProcessManagingEventHandler(TriggerlessEventHandler):
|
|||||||
self.key = key
|
self.key = key
|
||||||
self.monitor = dirmonitor
|
self.monitor = dirmonitor
|
||||||
self.processmanager = ProcessManager()
|
self.processmanager = ProcessManager()
|
||||||
self.uplink = ServerUplinkConnector()
|
|
||||||
|
|
||||||
def _with_monitor_paused(fun):
|
def _with_monitor_paused(fun):
|
||||||
@wraps(fun)
|
@wraps(fun)
|
||||||
@ -39,6 +37,6 @@ class ProcessManagingEventHandler(TriggerlessEventHandler):
|
|||||||
try:
|
try:
|
||||||
data = data_json['data']
|
data = data_json['data']
|
||||||
self.processmanager(data['command'], data['process_name'])
|
self.processmanager(data['command'], data['process_name'])
|
||||||
self.uplink.send(self.key, {'data': {'process_name': data['process_name']}})
|
return data_json
|
||||||
except KeyError:
|
except KeyError:
|
||||||
log.error('IGNORING MESSAGE: Invalid data_json received: {}'.format(data_json))
|
log.error('IGNORING MESSAGE: Invalid data_json received: {}'.format(data_json))
|
||||||
|
Loading…
Reference in New Issue
Block a user