Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/68251.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Speedup wheel key.finger call by removing redundant processing calls.
15 changes: 7 additions & 8 deletions salt/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,16 +511,15 @@ def glob_match(self, match, full=False):
ret = {}
if "," in match and isinstance(match, str):
match = match.split(",")
if not isinstance(match, list):
match = [match]
for status, keys in matches.items():
if match == ["*"] and keys:
ret[status] = keys
continue
for key in salt.utils.data.sorted_ignorecase(keys):
if isinstance(match, list):
for match_item in match:
if fnmatch.fnmatch(key, match_item):
if status not in ret:
ret[status] = []
ret[status].append(key)
else:
if fnmatch.fnmatch(key, match):
for match_item in match:
if fnmatch.fnmatch(key, match_item):
if status not in ret:
ret[status] = []
ret[status].append(key)
Expand Down
11 changes: 8 additions & 3 deletions salt/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -2269,12 +2269,17 @@ def wheel(self, clear_load):
"tag": tag,
"user": username,
}

self.event.fire_event(data, tagify([jid, "new"], "wheel"))
clear_load.update(
{
"__jid__": jid,
"__tag__": tag,
"__user__": username,
"print_event": clear_load.get("print_event", False),
}
)
ret = self.wheel_.call_func(fun, full_return=True, **clear_load)
data["return"] = ret["return"]
data["success"] = ret["success"]
self.event.fire_event(data, tagify([jid, "ret"], "wheel"))
return {"tag": tag, "data": data}
except Exception as exc: # pylint: disable=broad-except
log.error("Exception occurred while introspecting %s: %s", fun, exc)
Expand Down
Loading