forked from ungleich-public/cdist
catch some errors
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
parent
3244cfae85
commit
339167c23c
1 changed files with 8 additions and 5 deletions
|
@ -148,14 +148,17 @@ cp -L "$src" "$real_dst"
|
|||
|
||||
log.debug("Bootstrap: %s" % cmd)
|
||||
|
||||
# try:
|
||||
try:
|
||||
subprocess.check_call(cmd)
|
||||
# except subprocess.CalledProcessError:
|
||||
# raise
|
||||
except subprocess.CalledProcessError:
|
||||
raise cdist.Error("Debootstrap failed (root priviliges required)")
|
||||
|
||||
# Required to run this - otherwise apt-get install fails
|
||||
cmd = [ "chroot", self.target_dir, "/usr/bin/apt-get", "update" ]
|
||||
try:
|
||||
subprocess.check_call(cmd)
|
||||
except subprocess.CalledProcessError:
|
||||
raise cdist.Error("chrooted apt-get update failed (root priviliges required)")
|
||||
|
||||
def create_helper_files(self, base_dir):
|
||||
for key, val in self.helper.items():
|
||||
|
|
Loading…
Reference in a new issue