1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

removed defined/undefined as jinja2 already has em

This commit is contained in:
Brian Coca 2016-07-08 12:11:22 -04:00
parent 7f28bcacaa
commit 7657f75f75

View file

@ -84,15 +84,6 @@ def search(value, pattern='', ignorecase=False, multiline=False):
''' Perform a `re.search` returning a boolean '''
return regex(value, pattern, ignorecase, multiline, 'search')
def undefined(a):
''' Test if a variable is undefined '''
from jinja2.runtime import Undefined
return isinstance(a, Undefined)
def defined(a):
''' Test if a variable is defined '''
return not undefined(a)
class TestModule(object):
''' Ansible core jinja2 tests '''
@ -117,7 +108,4 @@ class TestModule(object):
'search': search,
'regex': regex,
# variable testing
'undefined': undefined,
'defined': defined,
}