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
b76efa39
Commit
b76efa39
authored
Aug 02, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some templating issues, needs testing with anti-unicode safeguard around shlex.split
parent
bd7de28a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
lib/ansible/playbook/task.py
+1
-1
lib/ansible/runner/__init__.py
+1
-1
lib/ansible/utils.py
+4
-3
No files found.
lib/ansible/playbook/task.py
View file @
b76efa39
...
...
@@ -83,7 +83,7 @@ class Task(object):
import_tags
=
import_tags
.
split
(
","
)
self
.
name
=
utils
.
template
(
self
.
name
,
self
.
module_vars
)
self
.
action
=
utils
.
template
(
self
.
name
,
self
.
module_vars
)
self
.
action
=
utils
.
template
(
self
.
action
,
self
.
module_vars
)
# handle mutually incompatible options
if
self
.
with_items
is
not
None
and
self
.
first_available_file
is
not
None
:
...
...
lib/ansible/runner/__init__.py
View file @
b76efa39
...
...
@@ -548,6 +548,7 @@ class Runner(object):
for
(
k
,
v
)
in
self
.
module_args
.
iteritems
():
new_args
=
new_args
+
"
%
s='
%
s' "
%
(
k
,
v
)
self
.
module_args
=
new_args
self
.
module_args
=
utils
.
template
(
self
.
module_args
,
inject
)
conditional
=
utils
.
template
(
self
.
conditional
,
inject
)
if
not
eval
(
conditional
):
...
...
@@ -586,7 +587,6 @@ class Runner(object):
changed
=
False
if
result
.
result
.
get
(
'changed'
,
False
)
or
result2
.
result
.
get
(
'changed'
,
False
):
changed
=
True
# print "DEBUG=%s" % changed
result2
.
result
.
update
(
result
.
result
)
result2
.
result
[
'changed'
]
=
changed
result
=
result2
...
...
lib/ansible/utils.py
View file @
b76efa39
...
...
@@ -204,7 +204,7 @@ def template(text, vars):
if
(
depth
>
20
):
raise
errors
.
AnsibleError
(
"template recursion depth exceeded"
)
prev_text
=
text
text
=
varReplace
(
unicode
(
text
),
vars
)
text
=
varReplace
(
unicode
(
text
),
vars
)
return
text
def
template_from_file
(
basedir
,
path
,
vars
):
...
...
@@ -238,10 +238,11 @@ def parse_kv(args):
options
=
{}
if
args
is
not
None
:
vargs
=
shlex
.
split
(
args
,
posix
=
True
)
# attempting to split a unicode here does bad things
vargs
=
shlex
.
split
(
str
(
args
),
posix
=
True
)
for
x
in
vargs
:
if
x
.
find
(
"="
)
!=
-
1
:
k
,
v
=
x
.
split
(
"="
,
1
)
k
,
v
=
x
.
split
(
"="
,
1
)
options
[
k
]
=
v
return
options
...
...
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