mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Add one-versus-many-matches logic to network filter plugin (#30511)
* Add one-versus-many-matches logic * Fixed indentation (tabs ==> spaces)
This commit is contained in:
committed by
Peter Sprygada
parent
d23af439ca
commit
9aa1da23f0
@@ -56,7 +56,10 @@ def re_matchall(regex, value):
|
||||
obj = {}
|
||||
if regex.groupindex:
|
||||
for name, index in iteritems(regex.groupindex):
|
||||
obj[name] = match[index - 1]
|
||||
if len(regex.groupindex) == 1:
|
||||
obj[name] = match
|
||||
else:
|
||||
obj[name] = match[index - 1]
|
||||
objects.append(obj)
|
||||
return objects
|
||||
|
||||
|
||||
Reference in New Issue
Block a user