Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
8ef28253
Commit
8ef28253
authored
Jun 27, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly catch and report conditional test failures
parent
0eb1c880
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
lib/ansible/playbook/conditional.py
+10
-3
No files found.
lib/ansible/playbook/conditional.py
View file @
8ef28253
...
...
@@ -19,6 +19,8 @@
from
__future__
import
(
absolute_import
,
division
,
print_function
)
__metaclass__
=
type
from
jinja2.exceptions
import
UndefinedError
from
ansible.errors
import
*
from
ansible.playbook.attribute
import
FieldAttribute
from
ansible.template
import
Templar
...
...
@@ -53,9 +55,14 @@ class Conditional:
False if any of them evaluate as such.
'''
for
conditional
in
self
.
when
:
if
not
self
.
_check_conditional
(
conditional
,
templar
,
all_vars
):
return
False
try
:
for
conditional
in
self
.
when
:
if
not
self
.
_check_conditional
(
conditional
,
templar
,
all_vars
):
return
False
except
UndefinedError
,
e
:
raise
AnsibleError
(
"The conditional check '
%
s' failed due to an undefined variable. The error was:
%
s"
%
(
conditional
,
e
),
obj
=
self
.
get_ds
())
except
Exception
,
e
:
raise
AnsibleError
(
"The conditional check '
%
s' failed. The error was:
%
s"
%
(
conditional
,
e
),
obj
=
self
.
get_ds
())
return
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment