Merge pull request #4970 from bcoca/set_diff

more set filters
This commit is contained in:
Michael DeHaan 2013-11-19 12:00:12 -08:00
commit a0c49fe0ec

View file

@ -126,6 +126,15 @@ def unique(a):
def intersect(a, b):
return set(a).intersection(b)
def difference(a, b):
return set(a).difference(b)
def symmetric_difference(a, b):
return set(a).symmetric_difference(b)
def union(a, b):
return set(a).union(b)
class FilterModule(object):
''' Ansible core jinja2 filters '''
@ -183,5 +192,8 @@ class FilterModule(object):
# list
'unique' : unique,
'intersect': intersect,
'difference': difference,
'symmetric_difference': symmetric_difference,
'union': union,
}