mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Fail when guest add. install exits with $? != 1
This commit is contained in:
parent
e388078de7
commit
b1195c5c3b
1 changed files with 7 additions and 3 deletions
|
@ -40,7 +40,6 @@ class InstallGuestAdditions(Task):
|
||||||
|
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
import os
|
import os
|
||||||
from common.tools import log_call
|
|
||||||
guest_additions_path = info.manifest.bootstrapper['guest_additions']
|
guest_additions_path = info.manifest.bootstrapper['guest_additions']
|
||||||
mount_dir = 'mnt/guest_additions'
|
mount_dir = 'mnt/guest_additions'
|
||||||
mount_path = os.path.join(info.root, mount_dir)
|
mount_path = os.path.join(info.root, mount_dir)
|
||||||
|
@ -49,9 +48,14 @@ class InstallGuestAdditions(Task):
|
||||||
root.add_mount(guest_additions_path, mount_path, ['-o', 'loop'])
|
root.add_mount(guest_additions_path, mount_path, ['-o', 'loop'])
|
||||||
|
|
||||||
install_script = os.path.join('/', mount_dir, 'VBoxLinuxAdditions.run')
|
install_script = os.path.join('/', mount_dir, 'VBoxLinuxAdditions.run')
|
||||||
|
from common.tools import log_call
|
||||||
|
status, out, err = log_call(['/usr/sbin/chroot', info.root,
|
||||||
|
install_script, '--nox11'])
|
||||||
# Install will exit with $?=1 because X11 isn't installed
|
# Install will exit with $?=1 because X11 isn't installed
|
||||||
log_call(['/usr/sbin/chroot', info.root,
|
if status != 1:
|
||||||
install_script, '--nox11'])
|
msg = ('VBoxLinuxAdditions.run exited with status {status}, '
|
||||||
|
'it should exit with status 1').format(status=status)
|
||||||
|
raise TaskError(msg)
|
||||||
|
|
||||||
root.remove_mount(mount_path)
|
root.remove_mount(mount_path)
|
||||||
os.rmdir(mount_path)
|
os.rmdir(mount_path)
|
||||||
|
|
Loading…
Add table
Reference in a new issue