mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2025-06-29 02:15:12 +00:00
Improve internal handling of environment variables
This commit is contained in:
committed by
therealkrispet
parent
a933248e90
commit
83b24ad538
@ -2,7 +2,7 @@ import zmq
|
||||
from zmq.eventloop.zmqstream import ZMQStream
|
||||
|
||||
from tfw.networking.serialization import serialize_all
|
||||
from tfw.config import PUBLISHER_PORT, RECEIVER_PORT
|
||||
from tfw.config import tfwenv
|
||||
from tfw.config.logs import logging
|
||||
log = logging.getLogger(__name__)
|
||||
from tfw.util import ZMQConnectorBase
|
||||
@ -13,7 +13,7 @@ class EventHandlerDownlinkConnector(ZMQConnectorBase):
|
||||
super(EventHandlerDownlinkConnector, self).__init__(zmq_context)
|
||||
self._zmq_pull_socket = self._zmq_context.socket(zmq.PULL)
|
||||
self._zmq_pull_stream = ZMQStream(self._zmq_pull_socket)
|
||||
address = 'tcp://*:{}'.format(RECEIVER_PORT)
|
||||
address = 'tcp://*:{}'.format(tfwenv.RECEIVER_PORT)
|
||||
self._zmq_pull_socket.bind(address)
|
||||
log.debug('Pull socket bound to {}'.format(address))
|
||||
|
||||
@ -22,7 +22,7 @@ class EventHandlerUplinkConnector(ZMQConnectorBase):
|
||||
def __init__(self, zmq_context=None):
|
||||
super(EventHandlerUplinkConnector, self).__init__(zmq_context)
|
||||
self._zmq_pub_socket = self._zmq_context.socket(zmq.PUB)
|
||||
address = 'tcp://*:{}'.format(PUBLISHER_PORT)
|
||||
address = 'tcp://*:{}'.format(tfwenv.PUBLISHER_PORT)
|
||||
self._zmq_pub_socket.bind(address)
|
||||
log.debug('Pub socket bound to {}'.format(address))
|
||||
|
||||
|
Reference in New Issue
Block a user