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
74bf6704
Commit
74bf6704
authored
Aug 07, 2015
by
Philippe Jandot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix remote source patch file
parent
6e430651
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
lib/ansible/runner/action_plugins/patch.py
+10
-4
No files found.
lib/ansible/runner/action_plugins/patch.py
View file @
74bf6704
...
...
@@ -16,6 +16,7 @@
import
os
from
ansible
import
utils
import
ansible.constants
as
C
from
ansible.runner.return_data
import
ReturnData
class
ActionModule
(
object
):
...
...
@@ -32,7 +33,7 @@ class ActionModule(object):
src
=
options
.
get
(
'src'
,
None
)
dest
=
options
.
get
(
'dest'
,
None
)
remote_src
=
utils
.
boolean
(
options
.
get
(
'remote_src'
,
'
yes
'
))
remote_src
=
utils
.
boolean
(
options
.
get
(
'remote_src'
,
'
no
'
))
if
src
is
None
:
result
=
dict
(
failed
=
True
,
msg
=
"src is required"
)
...
...
@@ -47,12 +48,13 @@ class ActionModule(object):
else
:
src
=
utils
.
path_dwim
(
self
.
runner
.
basedir
,
src
)
tmp_src
=
tmp
+
src
tmp_path
=
self
.
runner
.
_make_tmp_path
(
conn
)
tmp_src
=
tmp_path
+
'patch_source'
conn
.
put_file
(
src
,
tmp_src
)
if
self
.
runner
.
become
and
self
.
runner
.
become_user
!=
'root'
:
if
not
self
.
runner
.
noop_on_check
(
inject
):
self
.
runner
.
_remote_chmod
(
conn
,
'a+r'
,
tmp_src
,
tmp
)
self
.
runner
.
_remote_chmod
(
conn
,
'a+r'
,
tmp_src
,
tmp
_path
)
new_module_args
=
dict
(
src
=
tmp_src
,
...
...
@@ -63,4 +65,8 @@ class ActionModule(object):
module_args
=
utils
.
merge_module_args
(
module_args
,
new_module_args
)
return
self
.
runner
.
_execute_module
(
conn
,
tmp
,
'patch'
,
module_args
,
inject
=
inject
,
complex_args
=
complex_args
)
data
=
self
.
runner
.
_execute_module
(
conn
,
tmp
,
'patch'
,
module_args
,
inject
=
inject
,
complex_args
=
complex_args
)
if
not
C
.
DEFAULT_KEEP_REMOTE_FILES
:
self
.
runner
.
_remove_tmp_path
(
conn
,
tmp_path
)
return
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