From 4d3393b152a8d5baa1afc9af8834011f7cf8770d Mon Sep 17 00:00:00 2001 From: Martin Gracik Date: Fri, 26 Feb 2010 10:51:58 +0100 Subject: [PATCH] Remove old install.img if it already exists --- src/pylorax/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py index a588a335..3aaf0d70 100644 --- a/src/pylorax/__init__.py +++ b/src/pylorax/__init__.py @@ -281,6 +281,10 @@ class Lorax(BaseLoraxClass): self.treeinfo_add_section(self.conf.treeinfo, section, data) # move the install image to the images directory + dst = os.path.join(self.conf.imgdir, os.path.basename(installimg)) + if os.path.isfile(dst): + os.unlink(dst) + shutil.move(installimg, self.conf.imgdir) # create the boot iso image