|
|
@ -79,14 +79,6 @@ 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 mandatory(a):
|
|
|
|
|
|
|
|
from jinja2.runtime import Undefined
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
''' Make a variable mandatory '''
|
|
|
|
|
|
|
|
if isinstance(a, Undefined):
|
|
|
|
|
|
|
|
raise errors.AnsibleFilterError('Mandatory variable not defined.')
|
|
|
|
|
|
|
|
return a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestModule(object):
|
|
|
|
class TestModule(object):
|
|
|
|
''' Ansible core jinja2 tests '''
|
|
|
|
''' Ansible core jinja2 tests '''
|
|
|
|
|
|
|
|
|
|
|
@ -102,9 +94,6 @@ class TestModule(object):
|
|
|
|
# skip testing
|
|
|
|
# skip testing
|
|
|
|
'skipped' : skipped,
|
|
|
|
'skipped' : skipped,
|
|
|
|
|
|
|
|
|
|
|
|
# variable existence
|
|
|
|
|
|
|
|
'mandatory': mandatory,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# regex
|
|
|
|
# regex
|
|
|
|
'match': match,
|
|
|
|
'match': match,
|
|
|
|
'search': search,
|
|
|
|
'search': search,
|
|
|
|