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
ce88df3c
Commit
ce88df3c
authored
Oct 14, 2013
by
Paul Sokolovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy: Handle dest path variations for recursive mode.
parent
6cf3975e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
+9
-1
lib/ansible/runner/action_plugins/copy.py
+9
-1
No files found.
lib/ansible/runner/action_plugins/copy.py
View file @
ce88df3c
...
...
@@ -113,6 +113,10 @@ class ActionModule(object):
full_path
=
os
.
path
.
join
(
base_path
,
file
)
rel_path
=
full_path
[
sz
:]
source_files
.
append
((
full_path
,
rel_path
))
# If it's recursive copy, destination is always a dir,
# explictly mark it so (note - copy module relies on this).
if
not
dest
.
endswith
(
"/"
):
dest
+=
"/"
else
:
source_files
.
append
((
source
,
os
.
path
.
basename
(
source
)))
...
...
@@ -192,7 +196,11 @@ class ActionModule(object):
# don't send down raw=no
module_args
.
pop
(
'raw'
)
module_args_tmp
=
"
%
s src=
%
s original_basename=
%
s"
%
(
module_args
,
pipes
.
quote
(
tmp_src
),
pipes
.
quote
(
source_rel
))
# src and dest here come after original and override them
# we pass dest only to make sure it includes trailing slash
# in case of recursive copy
module_args_tmp
=
"
%
s src=
%
s dest=
%
s original_basename=
%
s"
%
(
module_args
,
pipes
.
quote
(
tmp_src
),
pipes
.
quote
(
dest
),
pipes
.
quote
(
source_rel
))
module_return
=
self
.
runner
.
_execute_module
(
conn
,
tmp
,
'copy'
,
module_args_tmp
,
inject
=
inject
,
complex_args
=
complex_args
)
else
:
...
...
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