mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-26 03:19:48 +00:00
Fix problem where plugins could be called twice for same data
If a plugin has a default and is also explicitly defined, the pluginapi would call the code twice. Correct this by avoiding calling the default if specific info not specified already
This commit is contained in:
parent
55ef78fc64
commit
285b1df3a5
@ -190,13 +190,15 @@ def handle_path(path, operation, configmanager, inputdata=None):
|
||||
elif 'pluginattrs' in plugroute:
|
||||
nodeattr = configmanager.get_node_attributes(
|
||||
[node], plugroute['pluginattrs'])
|
||||
foundplug = False
|
||||
for attrname in plugroute['pluginattrs']:
|
||||
if attrname in nodeattr[node]:
|
||||
foundplug = True
|
||||
passvalue = pluginmap[nodeattr[node][attrname]['value']].__dict__[operation](
|
||||
nodes=(node,), element=pathcomponents,
|
||||
configmanager=configmanager,
|
||||
inputdata=inputdata)
|
||||
if 'default' in plugroute:
|
||||
if (not foundplug) and 'default' in plugroute:
|
||||
passvalue = pluginmap[plugroute['default']].__dict__[operation](
|
||||
nodes=(node,), element=pathcomponents, configmanager=configmanager,
|
||||
inputdata=inputdata)
|
||||
|
Loading…
Reference in New Issue
Block a user