Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
037bed89
Commit
037bed89
authored
Mar 10, 2018
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issue #110: _transfer_data() must handle dicts and Unicode(!)
parent
e36c1763
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
ansible_mitogen/mixins.py
ansible_mitogen/mixins.py
+8
-0
No files found.
ansible_mitogen/mixins.py
View file @
037bed89
...
...
@@ -35,6 +35,9 @@ import shutil
import
tempfile
import
traceback
from
ansible.module_utils._text
import
to_bytes
from
ansible.parsing.utils.jsonify
import
jsonify
import
ansible
import
ansible.plugins
import
ansible.plugins.action
...
...
@@ -213,6 +216,11 @@ class ActionModuleMixin(ansible.plugins.action.ActionBase):
Used by the base _execute_module(), and in <2.4 also by the template
action module, and probably others.
"""
if
isinstance
(
data
,
dict
):
data
=
jsonify
(
data
)
if
not
isinstance
(
data
,
bytes
):
data
=
to_bytes
(
data
,
errors
=
'surrogate_or_strict'
)
LOG
.
debug
(
'_transfer_data(%r, %s ..%d bytes)'
,
remote_path
,
type
(
data
),
len
(
data
))
self
.
_connection
.
put_data
(
remote_path
,
data
)
...
...
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