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
b975ad7e
Commit
b975ad7e
authored
Feb 18, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6057 from risaacson/issues_5914
Copy action_plugin: encode content when dict.
parents
30611eaa
1ac19cb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
+7
-1
lib/ansible/runner/action_plugins/copy.py
+7
-1
No files found.
lib/ansible/runner/action_plugins/copy.py
View file @
b975ad7e
...
...
@@ -23,6 +23,7 @@ import ansible.utils.template as template
from
ansible
import
errors
from
ansible.runner.return_data
import
ReturnData
import
base64
import
json
import
stat
import
tempfile
import
pipes
...
...
@@ -71,7 +72,12 @@ class ActionModule(object):
# If content is defined make a temp file and write the content into it.
if
content
is
not
None
:
try
:
content_tempfile
=
self
.
_create_content_tempfile
(
content
)
# If content comes to us as a dict it should be decoded json.
# We need to encode it back into a string to write it out.
if
type
(
content
)
is
dict
:
content_tempfile
=
self
.
_create_content_tempfile
(
json
.
dumps
(
content
))
else
:
content_tempfile
=
self
.
_create_content_tempfile
(
content
)
source
=
content_tempfile
except
Exception
,
err
:
result
=
dict
(
failed
=
True
,
msg
=
"could not write content temp file:
%
s"
%
err
)
...
...
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