Check for negative defined logic in conditionals
(cherry picked from commit 8ee3ef587a
)
This commit is contained in:
parent
a34793d7fb
commit
528426ce0c
1 changed files with 2 additions and 2 deletions
|
@ -125,9 +125,9 @@ class Conditional:
|
||||||
# variable was undefined. If we happened to be
|
# variable was undefined. If we happened to be
|
||||||
# looking for an undefined variable, return True,
|
# looking for an undefined variable, return True,
|
||||||
# otherwise fail
|
# otherwise fail
|
||||||
if "is undefined" in original:
|
if "is undefined" in original or "is not defined" in original or "not is defined" in original:
|
||||||
return True
|
return True
|
||||||
elif "is defined" in original:
|
elif "is defined" in original or "is not undefined" in original or "not is undefined" in original:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
raise AnsibleUndefinedVariable("error while evaluating conditional (%s): %s" % (original, e))
|
raise AnsibleUndefinedVariable("error while evaluating conditional (%s): %s" % (original, e))
|
||||||
|
|
Loading…
Reference in a new issue