Merge pull request #10250 from cachedout/#9991

Match against lists in nested dicts in grains
This commit is contained in:
Thomas S Hatch 2014-02-07 21:24:45 -07:00
commit a407bb5cdc

View File

@ -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