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
a6029264
Commit
a6029264
authored
Oct 02, 2014
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove complex_args_hack as it was only needed for Baby JSON
parent
c83a8337
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
22 deletions
+0
-22
lib/ansible/runner/__init__.py
+0
-20
lib/ansible/runner/action_plugins/normal.py
+0
-2
No files found.
lib/ansible/runner/__init__.py
View file @
a6029264
...
...
@@ -253,26 +253,6 @@ class Runner(object):
# ensure we are using unique tmp paths
random
.
seed
()
# *****************************************************
def
_complex_args_hack
(
self
,
complex_args
,
module_args
):
"""
ansible-playbook both allows specifying key=value string arguments and complex arguments
however not all modules use our python common module system and cannot
access these. An example might be a Bash module. This hack allows users to still pass "args"
as a hash of simple scalars to those arguments and is short term. We could technically
just feed JSON to the module, but that makes it hard on Bash consumers. The way this is implemented
it does mean values in 'args' have LOWER priority than those on the key=value line, allowing
args to provide yet another way to have pluggable defaults.
"""
if
complex_args
is
None
:
return
module_args
if
not
isinstance
(
complex_args
,
dict
):
raise
errors
.
AnsibleError
(
"complex arguments are not a dictionary:
%
s"
%
complex_args
)
for
(
k
,
v
)
in
complex_args
.
iteritems
():
if
isinstance
(
v
,
basestring
):
module_args
=
"
%
s=
%
s
%
s"
%
(
k
,
pipes
.
quote
(
v
),
module_args
)
return
module_args
# *****************************************************
...
...
lib/ansible/runner/action_plugins/normal.py
View file @
a6029264
...
...
@@ -36,8 +36,6 @@ class ActionModule(object):
def
run
(
self
,
conn
,
tmp
,
module_name
,
module_args
,
inject
,
complex_args
=
None
,
**
kwargs
):
''' transfer & execute a module that is not 'copy' or 'template' '''
module_args
=
self
.
runner
.
_complex_args_hack
(
complex_args
,
module_args
)
if
self
.
runner
.
noop_on_check
(
inject
):
if
module_name
in
[
'shell'
,
'command'
]:
return
ReturnData
(
conn
=
conn
,
comm_ok
=
True
,
result
=
dict
(
skipped
=
True
,
msg
=
'check mode not supported for
%
s'
%
module_name
))
...
...
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