From b125c0a4f273acaf33a082f8179b69e3b765b7d0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 20 Jan 2014 09:21:50 +0100 Subject: [PATCH] create output directory, if it does not exist Signed-off-by: Nico Schottelius --- cdist/preos.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cdist/preos.py b/cdist/preos.py index b76d2178..f3d34c21 100644 --- a/cdist/preos.py +++ b/cdist/preos.py @@ -194,14 +194,21 @@ cp -L "$src" "$real_dst" log.info("Creating initramfs ...") subprocess.check_call(cmd, shell=True) + def ensure_out_dir_exists(self): + os.makedirs(self.out_dir, exist_ok=True) + + def create_iso(self, out_dir): self.out_dir = out_dir + self.ensure_out_dir_exists() + raise cdist.Error("Generating ISO is not yet supported") def create_pxe(self, out_dir): self.out_dir = out_dir + self.ensure_out_dir_exists() self.create_kernel() self.create_initramfs() self.create_pxeconfig()