From d6e6dbb4ee6ba91dec9f39fd78829a240af750f2 Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Sun, 7 Jul 2013 21:59:50 +0200 Subject: [PATCH] Fix weird exit status from debootstrap --- providers/ec2/tasks/bootstrap.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/providers/ec2/tasks/bootstrap.py b/providers/ec2/tasks/bootstrap.py index 78746b1..0ba9326 100644 --- a/providers/ec2/tasks/bootstrap.py +++ b/providers/ec2/tasks/bootstrap.py @@ -1,6 +1,6 @@ from base import Task from common import phases -from common.tools import log_check_call +from common.exceptions import TaskError import logging log = logging.getLogger(__name__) @@ -31,7 +31,11 @@ class MakeTarball(Task): if os.path.isfile(info.tarball): log.debug('Found matching tarball, skipping download') else: - log_check_call(executable + options + ['--make-tarball=' + info.tarball] + arguments) + from common.tools import log_call + status, out, err = log_call(executable + options + ['--make-tarball=' + info.tarball] + arguments) + if status != 1: + msg = 'debootstrap exited with status {status}, it should exit with status 1'.format(status=status) + raise TaskError(msg) class Bootstrap(Task): @@ -44,4 +48,5 @@ class Bootstrap(Task): if hasattr(info, 'tarball'): options.extend(['--unpack-tarball=' + info.tarball]) + from common.tools import log_check_call log_check_call(executable + options + arguments)