mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Collect all missing host pkgs before erroring out
This commit is contained in:
parent
f4a00b7eb1
commit
065e6fdb5c
1 changed files with 9 additions and 2 deletions
|
@ -32,9 +32,16 @@ class CheckHostDependencies(Task):
|
||||||
def run(cls, info):
|
def run(cls, info):
|
||||||
from common.tools import log_check_call
|
from common.tools import log_check_call
|
||||||
from subprocess import CalledProcessError
|
from subprocess import CalledProcessError
|
||||||
|
missing_packages = []
|
||||||
for package in info.host_dependencies:
|
for package in info.host_dependencies:
|
||||||
try:
|
try:
|
||||||
log_check_call(['/usr/bin/dpkg-query', '-s', package])
|
log_check_call(['/usr/bin/dpkg-query', '-s', package])
|
||||||
except CalledProcessError:
|
except CalledProcessError:
|
||||||
msg = "The package `{0}\' is not installed".format(package)
|
missing_packages.append(package)
|
||||||
raise TaskError(msg)
|
if len(missing_packages) > 0:
|
||||||
|
pkgs = '\', `'.join(missing_packages)
|
||||||
|
if len(missing_packages) > 1:
|
||||||
|
msg = "The packages `{packages}\' are not installed".format(packages=pkgs)
|
||||||
|
else:
|
||||||
|
msg = "The package `{packages}\' is not installed".format(packages=pkgs)
|
||||||
|
raise TaskError(msg)
|
||||||
|
|
Loading…
Add table
Reference in a new issue