Skip to content

Commit

Permalink
Support a list of scalars as attr value in listify filter
Browse files Browse the repository at this point in the history
  • Loading branch information
velotiger committed Nov 5, 2023
1 parent 5a66f82 commit eed6b9a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/filter/aci2.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ def worker(itemList, depth, result, cache, prefix):
# All key/value pairs are evaluated before dicts and lists.
# Otherwise, some attributes might not be transferred from the
# cache to the result list.
elif isinstance(item[subItem], list):
# Support a list of scalars as attribute value.
for listItem in item[subItem]:
if isinstance(listItem, (dict, list)):
break
else:
subcache['%s%s' % (prefix, subItem)] = item[subItem]
if regexList[depth] is not None and (name is None or not regexList[depth].fullmatch(name)):
# If regex was specified and the nameAttr does not match, do
# not follow the path but continue with next item. Also a
Expand Down

0 comments on commit eed6b9a

Please sign in to comment.