From: Eugene Crosser Date: Tue, 31 May 2022 20:54:24 +0000 (+0200) Subject: make termconfig use unit specific config section X-Git-Tag: 0.98~6 X-Git-Url: http://www.average.org/gitweb/?p=loctrkd.git;a=commitdiff_plain;h=428cb6396a46338d3681fca111f983cd5f8876d5 make termconfig use unit specific config section --- diff --git a/gps303/termconfig.py b/gps303/termconfig.py index eb3150b..953e6ae 100644 --- a/gps303/termconfig.py +++ b/gps303/termconfig.py @@ -14,7 +14,6 @@ log = getLogger("gps303/termconfig") def runserver(conf: ConfigParser) -> None: - termconfig = common.normconf(conf["termconfig"]) # Is this https://github.com/zeromq/pyzmq/issues/1627 still not fixed?! zctx = zmq.Context() # type: ignore zsub = zctx.socket(zmq.SUB) # type: ignore @@ -43,6 +42,10 @@ def runserver(conf: ConfigParser) -> None: log.error( "%s does not expect externally provided response", msg ) + if zmsg.imei is not None and conf.has_section(zmsg.imei): + termconfig = common.normconf(conf[zmsg.imei]) + else: + termconfig = common.normconf(conf["termconfig"]) kwargs = {} if isinstance(msg, STATUS): kwargs = {