From 428cb6396a46338d3681fca111f983cd5f8876d5 Mon Sep 17 00:00:00 2001 From: Eugene Crosser Date: Tue, 31 May 2022 22:54:24 +0200 Subject: [PATCH] make termconfig use unit specific config section --- gps303/termconfig.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 = { -- 2.39.2