def set_target_path(self): '''Set the target path for the finished stage. This method runs the StageBase.set_target_path mehtod, and additionally creates a staging directory for assembling the final components needed to produce the iso image. ''' super(livecd_stage2, self).set_target_path() clear_dir(self.settings['target_path'])
def empty(self): if "autoresume" in self.settings["options"] \ and self.resume.is_enabled("empty"): log.notice('Resume point detected, skipping empty operation...') else: if "netboot2/empty" in self.settings: if isinstance(self.settings['netboot2/empty'], str): self.settings["netboot2/empty"]=self.settings["netboot2/empty"].split() for x in self.settings["netboot2/empty"]: myemp=self.settings["chroot_path"] + self.settings["merge_path"] + x if not os.path.isdir(myemp): log.warning('not a directory or does not exist, skipping "empty" operation: %s', x) continue log.info('Emptying directory %s', x) # stat the dir, delete the dir, recreate the dir and set # the proper perms and ownership clear_dir(myemp) self.resume.enable("empty")
def clear_all(self, remove=False): '''Clear all active resume points @remove: boolean, passed through to clear_dir() @return boolean ''' if clear_dir(self.basedir, mode=0o755, chg_flags=True, remove=remove): self._points = {} return True return False
def clear_all(self, remove=False): '''Clear all active resume points @return boolean ''' if clear_dir(self.basedir, mode=0755, chg_flags=True, remove=remove):
def clear_kerncache(self, remove=False): if "kerncache" in self.settings["options"]: print "purging the kerncache ..." clear_dir(self.settings["kerncache_path"], remove=remove)
def clear_packages(self, remove=False): if "pkgcache" in self.settings["options"]: print "purging the pkgcache ..." clear_dir(self.settings["pkgcache_path"], remove=remove)
def clear_kerncache(self, remove=False): if "kerncache" in self.settings["options"]: log.notice('purging the kerncache ...') clear_dir(self.settings["kerncache_path"], remove=remove)
def clear_packages(self, remove=False): if "pkgcache" in self.settings["options"]: log.notice('purging the pkgcache ...') clear_dir(self.settings["pkgcache_path"], remove=remove)
def remove_chroot(self): log.notice('Removing the chroot path ...') clear_dir(self.settings["chroot_path"], mode=0o755, remove=True)
def clear_chroot(self): log.notice('Clearing the chroot path ...') clear_dir(self.settings["chroot_path"], mode=0o755)
def purge(self): clear_dir(self.settings['tmp_path'])
def remove_chroot(self): self.chroot_lock.unlock() log.notice('Removing the chroot path ...') clear_dir(self.settings["chroot_path"], mode=0o755, chg_flags=True, remove=True)
def clear_chroot(self): self.chroot_lock.unlock() log.notice('Clearing the chroot path ...') clear_dir(self.settings["chroot_path"], 0o755, True)