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
b63af1de
Commit
b63af1de
authored
Mar 08, 2018
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ansible: implement _transfer_data for <2.4 template action
parent
7aca02c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
ansible_mitogen/connection.py
ansible_mitogen/connection.py
+14
-2
ansible_mitogen/mixins.py
ansible_mitogen/mixins.py
+3
-3
No files found.
ansible_mitogen/connection.py
View file @
b63af1de
...
...
@@ -262,6 +262,19 @@ class Connection(ansible.plugins.connection.ConnectionBase):
cast
(
in_path
))
ansible_mitogen
.
helpers
.
write_path
(
out_path
,
output
)
def
put_data
(
self
,
out_path
,
data
):
"""
Implement put_file() by caling the corresponding
ansible_mitogen.helpers function in the target.
:param str in_path:
Local filesystem path to read.
:param str out_path:
Remote filesystem path to write.
"""
self
.
call
(
ansible_mitogen
.
helpers
.
write_path
,
cast
(
out_path
),
cast
(
data
))
def
put_file
(
self
,
in_path
,
out_path
):
"""
Implement put_file() by caling the corresponding
...
...
@@ -272,5 +285,4 @@ class Connection(ansible.plugins.connection.ConnectionBase):
:param str out_path:
Remote filesystem path to write.
"""
self
.
call
(
ansible_mitogen
.
helpers
.
write_path
,
cast
(
out_path
),
ansible_mitogen
.
helpers
.
read_path
(
in_path
))
self
.
put_data
(
out_path
,
ansible_mitogen
.
helpers
.
read_path
(
in_path
))
ansible_mitogen/mixins.py
View file @
b63af1de
...
...
@@ -202,10 +202,10 @@ class ActionModuleMixin(ansible.plugins.action.ActionBase):
def
_transfer_data
(
self
,
remote_path
,
data
):
"""
This is used by the base implementation of _execute_module(), it should
never be called
.
Used by the base _execute_module(), and in <2.4 also by the template
action module, and probably others
.
"""
assert
False
,
"_transfer_data() should never be called."
self
.
_connection
.
put_data
(
remote_path
,
data
)
def
_fixup_perms2
(
self
,
remote_paths
,
remote_user
=
None
,
execute
=
True
):
"""
...
...
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