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
45a161b0
Commit
45a161b0
authored
Oct 09, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12429 from edmstudio/devel
Update synchronize module plugin to work on OS X
parents
676e4232
6e035a3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
lib/ansible/plugins/action/synchronize.py
+17
-8
No files found.
lib/ansible/plugins/action/synchronize.py
View file @
45a161b0
...
...
@@ -44,13 +44,25 @@ class ActionModule(ActionBase):
return
path
def
_host_is_ipv6_address
(
self
,
host
):
return
':'
in
host
def
_format_rsync_rsh_target
(
self
,
host
,
path
,
user
):
''' formats rsync rsh target, escaping ipv6 addresses if needed '''
user_prefix
=
''
if
user
:
user_prefix
=
'
%
s@'
%
(
user
,
)
if
self
.
_host_is_ipv6_address
(
host
):
return
'[
%
s
%
s]:
%
s'
%
(
user_prefix
,
host
,
path
)
else
:
return
'
%
s
%
s:
%
s'
%
(
user_prefix
,
host
,
path
)
def
_process_origin
(
self
,
host
,
path
,
user
):
if
host
not
in
C
.
LOCALHOST
:
if
user
:
return
'
%
s@[
%
s]:
%
s'
%
(
user
,
host
,
path
)
else
:
return
'[
%
s]:
%
s'
%
(
host
,
path
)
return
self
.
_format_rsync_rsh_target
(
host
,
path
,
user
)
if
':'
not
in
path
and
not
path
.
startswith
(
'/'
):
path
=
self
.
_get_absolute_path
(
path
=
path
)
...
...
@@ -59,10 +71,7 @@ class ActionModule(ActionBase):
def
_process_remote
(
self
,
host
,
path
,
user
):
transport
=
self
.
_play_context
.
connection
if
host
not
in
C
.
LOCALHOST
or
transport
!=
"local"
:
if
user
:
return
'
%
s@[
%
s]:
%
s'
%
(
user
,
host
,
path
)
else
:
return
'[
%
s]:
%
s'
%
(
host
,
path
)
return
self
.
_format_rsync_rsh_target
(
host
,
path
,
user
)
if
':'
not
in
path
and
not
path
.
startswith
(
'/'
):
path
=
self
.
_get_absolute_path
(
path
=
path
)
...
...
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