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
0e834509
Commit
0e834509
authored
Feb 10, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix in v2 for bare variable conversion
parent
38b0a6ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
v2/ansible/playbook/conditional.py
+5
-7
No files found.
v2/ansible/playbook/conditional.py
View file @
0e834509
...
...
@@ -70,12 +70,10 @@ class Conditional:
if
conditional
is
None
or
conditional
==
''
:
return
True
# FIXME: this should be removable now, leaving it here just in case
# allow variable names
#if conditional in all_vars and '-' not in str(all_vars[conditional]):
# conditional = all_vars[conditional]
if
conditional
in
all_vars
and
'-'
not
in
unicode
(
all_vars
[
conditional
]):
conditional
=
all_vars
[
conditional
]
conditional
=
templar
.
template
(
conditional
,
convert_bare
=
True
)
conditional
=
templar
.
template
(
conditional
)
if
not
isinstance
(
conditional
,
basestring
)
or
conditional
==
""
:
return
conditional
...
...
@@ -89,9 +87,9 @@ class Conditional:
# variable was undefined. If we happened to be
# looking for an undefined variable, return True,
# otherwise fail
if
"is undefined"
in
conditio
nal
:
if
"is undefined"
in
origi
nal
:
return
True
elif
"is defined"
in
conditio
nal
:
elif
"is defined"
in
origi
nal
:
return
False
else
:
raise
AnsibleError
(
"error while evaluating conditional:
%
s"
%
original
)
...
...
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