MCPcopy
hub / github.com/saltstack/salt / list_match

Method list_match

salt/key.py:536–557  ·  view source on GitHub ↗

Accept a glob which to match the of a key and return the key's location

(self, match)

Source from the content-addressed store, hash-verified

534 return ret
535
536 def list_match(self, match):
537 """
538 Accept a glob which to match the of a key and return the key's location
539 """
540 ret = {}
541 if isinstance(match, str):
542 match = match.split(",")
543
544 for name in match:
545 key = self.cache.fetch("keys", name)
546 if key:
547 try:
548 ret.setdefault(self.STATE_MAP[key["state"]], [])
549 ret[self.STATE_MAP[key["state"]]].append(name)
550 except KeyError:
551 log.error("unexpected key state returned for %s: %s", name, key)
552
553 denied_keys = self.cache.fetch("denied_keys", name)
554 if denied_keys:
555 ret.setdefault(self.DEN, [])
556 ret[self.DEN].append(name)
557 return ret
558
559 def dict_match(self, match_dict):
560 """

Callers 1

_check_list_minionsMethod · 0.80

Calls 4

fetchMethod · 0.45
setdefaultMethod · 0.45
appendMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected