mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +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):
|
||||
from common.tools import log_check_call
|
||||
from subprocess import CalledProcessError
|
||||
missing_packages = []
|
||||
for package in info.host_dependencies:
|
||||
try:
|
||||
log_check_call(['/usr/bin/dpkg-query', '-s', package])
|
||||
except CalledProcessError:
|
||||
msg = "The package `{0}\' is not installed".format(package)
|
||||
missing_packages.append(package)
|
||||
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