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
f0302f2e
Commit
f0302f2e
authored
Jun 19, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix problem with jail and zone connection plugins and symlinks from within the jail/zone.
parent
a431098f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
lib/ansible/runner/connection_plugins/jail.py
+9
-5
lib/ansible/runner/connection_plugins/zone.py
+9
-2
No files found.
lib/ansible/runner/connection_plugins/jail.py
View file @
f0302f2e
...
...
@@ -59,8 +59,6 @@ class Connection(object):
# remove \n
return
stdout
[:
-
1
]
def
__init__
(
self
,
runner
,
host
,
port
,
*
args
,
**
kwargs
):
self
.
jail
=
host
self
.
runner
=
runner
...
...
@@ -73,7 +71,7 @@ class Connection(object):
self
.
jls_cmd
=
self
.
_search_executable
(
'jls'
)
self
.
jexec_cmd
=
self
.
_search_executable
(
'jexec'
)
if
not
self
.
jail
in
self
.
list_jails
():
raise
errors
.
AnsibleError
(
"incorrect jail name
%
s"
%
self
.
jail
)
...
...
@@ -137,7 +135,10 @@ class Connection(object):
vvv
(
"PUT
%
s TO
%
s"
%
(
in_path
,
out_path
),
host
=
self
.
jail
)
with
open
(
in_path
,
'rb'
)
as
in_file
:
p
=
self
.
_buffered_exec_command
(
'dd of=
%
s'
%
out_path
,
None
,
stdin
=
in_file
)
try
:
p
=
self
.
_buffered_exec_command
(
'dd of=
%
s'
%
out_path
,
None
,
stdin
=
in_file
)
except
OSError
:
raise
errors
.
AnsibleError
(
"jail connection requires dd command in the jail"
)
try
:
stdout
,
stderr
=
p
.
communicate
()
except
:
...
...
@@ -152,7 +153,10 @@ class Connection(object):
vvv
(
"FETCH
%
s TO
%
s"
%
(
in_path
,
out_path
),
host
=
self
.
jail
)
p
=
self
.
_buffered_exec_command
(
'dd if=
%
s bs=
%
s'
%
(
in_path
,
BUFSIZE
),
None
)
try
:
p
=
self
.
_buffered_exec_command
(
'dd if=
%
s bs=
%
s'
%
(
in_path
,
BUFSIZE
),
None
)
except
OSError
:
raise
errors
.
AnsibleError
(
"jail connection requires dd command in the jail"
)
with
open
(
out_path
,
'wb+'
)
as
out_file
:
try
:
...
...
lib/ansible/runner/connection_plugins/zone.py
View file @
f0302f2e
...
...
@@ -148,7 +148,10 @@ class Connection(object):
vvv
(
"PUT
%
s TO
%
s"
%
(
in_path
,
out_path
),
host
=
self
.
zone
)
with
open
(
in_path
,
'rb'
)
as
in_file
:
p
=
self
.
_buffered_exec_command
(
'dd of=
%
s'
%
out_path
,
None
,
stdin
=
in_file
)
try
:
p
=
self
.
_buffered_exec_command
(
'dd of=
%
s'
%
out_path
,
None
,
stdin
=
in_file
)
except
OSError
:
raise
errors
.
AnsibleError
(
"zone connection requires dd command in the zone"
)
try
:
stdout
,
stderr
=
p
.
communicate
()
except
:
...
...
@@ -163,7 +166,11 @@ class Connection(object):
vvv
(
"FETCH
%
s TO
%
s"
%
(
in_path
,
out_path
),
host
=
self
.
zone
)
p
=
self
.
_buffered_exec_command
(
'dd if=
%
s bs=
%
s'
%
(
in_path
,
BUFSIZE
),
None
)
try
:
p
=
self
.
_buffered_exec_command
(
'dd if=
%
s bs=
%
s'
%
(
in_path
,
BUFSIZE
),
None
)
except
OSError
:
raise
errors
.
AnsibleError
(
"zone connection requires dd command in the zone"
)
with
open
(
out_path
,
'wb+'
)
as
out_file
:
try
:
...
...
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