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
6e2ea327
Commit
6e2ea327
authored
Mar 11, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A very simple fix to enable spaces in the files sent via the copy module.
parent
4eaca086
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
lib/ansible/module_common.py
+2
-2
lib/ansible/runner/action_plugins/copy.py
+3
-2
No files found.
lib/ansible/module_common.py
View file @
6e2ea327
...
@@ -629,8 +629,8 @@ class AnsibleModule(object):
...
@@ -629,8 +629,8 @@ class AnsibleModule(object):
for x in items:
for x in items:
try:
try:
(k, v) = x.split("=",1)
(k, v) = x.split("=",1)
except:
except
Exception, e
:
self.fail_json(msg="this module requires key=value arguments
"
)
self.fail_json(msg="this module requires key=value arguments
(
%
s)"
%
items
)
params[k] = v
params[k] = v
params2 = json.loads(MODULE_COMPLEX_ARGS)
params2 = json.loads(MODULE_COMPLEX_ARGS)
params2.update(params)
params2.update(params)
...
...
lib/ansible/runner/action_plugins/copy.py
View file @
6e2ea327
...
@@ -23,6 +23,7 @@ from ansible.runner.return_data import ReturnData
...
@@ -23,6 +23,7 @@ from ansible.runner.return_data import ReturnData
import
base64
import
base64
import
stat
import
stat
import
tempfile
import
tempfile
import
pipes
class
ActionModule
(
object
):
class
ActionModule
(
object
):
...
@@ -119,7 +120,7 @@ class ActionModule(object):
...
@@ -119,7 +120,7 @@ class ActionModule(object):
self
.
runner
.
_low_level_exec_command
(
conn
,
"chmod a+r
%
s"
%
tmp_src
,
tmp
)
self
.
runner
.
_low_level_exec_command
(
conn
,
"chmod a+r
%
s"
%
tmp_src
,
tmp
)
# run the copy module
# run the copy module
module_args
=
"
%
s src=
%
s"
%
(
module_args
,
tmp_src
)
module_args
=
"
%
s src=
%
s"
%
(
module_args
,
pipes
.
quote
(
tmp_src
)
)
return
self
.
runner
.
_execute_module
(
conn
,
tmp
,
'copy'
,
module_args
,
inject
=
inject
,
complex_args
=
complex_args
)
return
self
.
runner
.
_execute_module
(
conn
,
tmp
,
'copy'
,
module_args
,
inject
=
inject
,
complex_args
=
complex_args
)
else
:
else
:
...
@@ -129,7 +130,7 @@ class ActionModule(object):
...
@@ -129,7 +130,7 @@ class ActionModule(object):
if
content
is
not
None
:
if
content
is
not
None
:
os
.
remove
(
tmp_content
)
os
.
remove
(
tmp_content
)
tmp_src
=
tmp
+
os
.
path
.
basename
(
source
)
tmp_src
=
tmp
+
os
.
path
.
basename
(
source
)
module_args
=
"
%
s src=
%
s"
%
(
module_args
,
tmp_src
)
module_args
=
"
%
s src=
%
s"
%
(
module_args
,
pipes
.
quote
(
tmp_src
)
)
if
self
.
runner
.
check
:
if
self
.
runner
.
check
:
module_args
=
"
%
s CHECKMODE=True"
%
module_args
module_args
=
"
%
s CHECKMODE=True"
%
module_args
return
self
.
runner
.
_execute_module
(
conn
,
tmp
,
'file'
,
module_args
,
inject
=
inject
,
complex_args
=
complex_args
)
return
self
.
runner
.
_execute_module
(
conn
,
tmp
,
'file'
,
module_args
,
inject
=
inject
,
complex_args
=
complex_args
)
...
...
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