Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
04847191
Commit
04847191
authored
Nov 14, 2013
by
jctanner
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4879 from bcoca/unique_intersect
added unique and intersect filters for dealing with lists
parents
0f0a89b3
efd87534
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
lib/ansible/runner/filter_plugins/core.py
+10
-0
No files found.
lib/ansible/runner/filter_plugins/core.py
View file @
04847191
...
@@ -120,6 +120,12 @@ def search(value, pattern='', ignorecase=False):
...
@@ -120,6 +120,12 @@ def search(value, pattern='', ignorecase=False):
''' Perform a `re.search` returning a boolean '''
''' Perform a `re.search` returning a boolean '''
return
regex
(
value
,
pattern
,
ignorecase
,
'search'
)
return
regex
(
value
,
pattern
,
ignorecase
,
'search'
)
def
unique
(
a
):
return
set
(
a
)
def
intersect
(
a
,
b
):
return
set
(
a
)
.
intersection
(
b
)
class
FilterModule
(
object
):
class
FilterModule
(
object
):
''' Ansible core jinja2 filters '''
''' Ansible core jinja2 filters '''
...
@@ -173,5 +179,9 @@ class FilterModule(object):
...
@@ -173,5 +179,9 @@ class FilterModule(object):
'match'
:
match
,
'match'
:
match
,
'search'
:
search
,
'search'
:
search
,
'regex'
:
regex
,
'regex'
:
regex
,
# list
'unique'
:
unique
,
'intersect'
:
intersect
,
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment