From eaffac04332a6d9bc5428970a10f85ebdb55ea47 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 30 Jun 2022 13:27:25 -0400 Subject: [PATCH] Allow blanking a value to default a plugin attribute --- confluent_server/confluent/core.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/confluent_server/confluent/core.py b/confluent_server/confluent/core.py index 6d7d9366..aeec5c8d 100644 --- a/confluent_server/confluent/core.py +++ b/confluent_server/confluent/core.py @@ -823,17 +823,17 @@ def handle_dispatch(connection, cert, dispatch, peername): connection.close() return plugroute = routespec.routeinfo - plugpath = None nodesbyhandler = {} passvalues = [] nodeattr = configmanager.get_node_attributes( nodes, plugroute['pluginattrs']) for node in nodes: + plugpath = None for attrname in plugroute['pluginattrs']: if attrname in nodeattr[node]: plugpath = nodeattr[node][attrname]['value'] - elif 'default' in plugroute: - plugpath = plugroute['default'] + if not plugpath and 'default' in plugroute: + plugpath = plugroute['default'] if plugpath: try: hfunc = getattr(pluginmap[plugpath], operation) @@ -990,15 +990,15 @@ def handle_node_request(configmanager, inputdata, operation, elif 'pluginattrs' in plugroute: nodeattr = configmanager.get_node_attributes( nodes, plugroute['pluginattrs'] + ['collective.manager']) - plugpath = None nodesbymanager = {} nodesbyhandler = {} badcollnodes = [] for node in nodes: + plugpath = None for attrname in plugroute['pluginattrs']: if attrname in nodeattr[node]: plugpath = nodeattr[node][attrname]['value'] - elif 'default' in plugroute: + if not plugpath and 'default' in plugroute: plugpath = plugroute['default'] if plugpath in dispatch_plugins: cfm.check_quorum()