Ejemplo n.º 1
0
	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'])
Ejemplo n.º 2
0
	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'])
Ejemplo n.º 3
0
	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")
Ejemplo n.º 4
0
	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
Ejemplo n.º 5
0
    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
Ejemplo n.º 6
0
    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):
Ejemplo n.º 7
0
	def clear_kerncache(self, remove=False):
		if "kerncache" in self.settings["options"]:
			print "purging the kerncache ..."
			clear_dir(self.settings["kerncache_path"], remove=remove)
Ejemplo n.º 8
0
	def clear_packages(self, remove=False):
		if "pkgcache" in self.settings["options"]:
			print "purging the pkgcache ..."
			clear_dir(self.settings["pkgcache_path"], remove=remove)
Ejemplo n.º 9
0
 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)
Ejemplo n.º 10
0
 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)
Ejemplo n.º 11
0
 def remove_chroot(self):
     log.notice('Removing the chroot path ...')
     clear_dir(self.settings["chroot_path"], mode=0o755, remove=True)
Ejemplo n.º 12
0
 def clear_chroot(self):
     log.notice('Clearing the chroot path ...')
     clear_dir(self.settings["chroot_path"], mode=0o755)
Ejemplo n.º 13
0
	def purge(self):
		clear_dir(self.settings['tmp_path'])
Ejemplo n.º 14
0
	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)
Ejemplo n.º 15
0
 def clear_chroot(self):
     self.chroot_lock.unlock()
     log.notice('Clearing the chroot path ...')
     clear_dir(self.settings["chroot_path"], 0o755, True)