mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #10250 from cachedout/#9991
Match against lists in nested dicts in grains
This commit is contained in:
commit
a407bb5cdc
@ -1099,6 +1099,11 @@ def subdict_match(data, expr, delim=':', regex_match=False):
|
||||
if isinstance(match, list):
|
||||
# We are matching a single component to a single list member
|
||||
for member in match:
|
||||
if isinstance(member, dict):
|
||||
if matchstr.startswith('*:'):
|
||||
matchstr = matchstr[2:]
|
||||
if subdict_match(member, matchstr, regex_match=regex_match):
|
||||
return True
|
||||
if _match(member, matchstr, regex_match=regex_match):
|
||||
return True
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user