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
7dfb29f8
Commit
7dfb29f8
authored
May 18, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2952 from mmoya/bug-fixes
Don't hardcode chroot path
parents
e53a9e57
60f24bb0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
lib/ansible/runner/connection_plugins/chroot.py
+7
-7
No files found.
lib/ansible/runner/connection_plugins/chroot.py
View file @
7dfb29f8
...
...
@@ -16,13 +16,11 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
import
distutils.spawn
import
traceback
import
os
import
pipes
import
shutil
import
subprocess
import
select
import
fcntl
from
ansible
import
errors
from
ansible
import
utils
from
ansible.callbacks
import
vvv
...
...
@@ -45,6 +43,10 @@ class Connection(object):
if
not
utils
.
is_executable
(
chrootsh
):
raise
errors
.
AnsibleError
(
"
%
s does not look like a chrootable dir (/bin/sh missing)"
%
self
.
chroot
)
self
.
chroot_cmd
=
distutils
.
spawn
.
find_executable
(
'chroot'
)
if
not
self
.
chroot_cmd
:
raise
errors
.
AnsibleError
(
"chroot command not found in PATH"
)
self
.
runner
=
runner
self
.
host
=
host
# port is unused, since this is local
...
...
@@ -62,12 +64,10 @@ class Connection(object):
# We enter chroot as root so sudo stuff can be ignored
chroot_cmd
=
'/usr/sbin/chroot'
if
executable
:
local_cmd
=
[
chroot_cmd
,
self
.
chroot
,
executable
,
'-c'
,
cmd
]
local_cmd
=
[
self
.
chroot_cmd
,
self
.
chroot
,
executable
,
'-c'
,
cmd
]
else
:
local_cmd
=
'
%
s "
%
s"
%
s'
%
(
chroot_cmd
,
self
.
chroot
,
cmd
)
local_cmd
=
'
%
s "
%
s"
%
s'
%
(
self
.
chroot_cmd
,
self
.
chroot
,
cmd
)
vvv
(
"EXEC
%
s"
%
(
local_cmd
),
host
=
self
.
chroot
)
p
=
subprocess
.
Popen
(
local_cmd
,
shell
=
isinstance
(
local_cmd
,
basestring
),
...
...
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