Merge pull request #4970 from bcoca/set_diff

more set filters
pull/4960/merge
Michael DeHaan 11 years ago
commit a0c49fe0ec

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

Loading…
Cancel
Save