Speed up salt.matcher.confirm_top by using __context__

This commit is contained in:
vzhestkov 2024-05-08 12:57:28 +02:00 committed by Daniel Wozniak
parent eff969d280
commit 4923679536

View file

@ -22,7 +22,11 @@ def confirm_top(match, data, nodegroups=None):
if "match" in item:
matcher = item["match"]
matchers = salt.loader.matchers(__opts__)
if "matchers" in __context__:
matchers = __context__["matchers"]
else:
matchers = salt.loader.matchers(__opts__)
__context__["matchers"] = matchers
funcname = matcher + "_match.match"
if matcher == "nodegroup":
return matchers[funcname](match, nodegroups)