示例#1
0
 def switch_dir(self):
     """Switch to current directory"""
     com_dir = self.get_common_dir()
     if not os.path.exists(com_dir):
         utils.check_or_create_temp_dir(com_dir)
     self.cwd = os.getcwd()
     os.chdir(self.get_common_dir())
示例#2
0
 def switch_dir(self):
     """Switch to current directory"""
     com_dir = self.get_common_dir()
     if not os.path.exists(com_dir):
         utils.check_or_create_temp_dir(com_dir)
     self.cwd = os.getcwd()
     os.chdir(self.get_common_dir())
示例#3
0
    def prepare_scan_directories(self):
        """Used for prepartion of directories used during scan functionality"""
        self.basename = os.path.basename(self.content)
        #today = datetime.datetime.today()
        if not self.conf.temp_dir:
            check_or_create_temp_dir(self.conf.result_dir)
        check_or_create_temp_dir(self.conf.result_dir)
        check_or_create_temp_dir(settings.tarball_result_dir)
        for dir_name in settings.preupgrade_dirs:
            check_or_create_temp_dir(os.path.join(self.conf.result_dir, dir_name))

        # Copy README files into proper directories
        for key, val in six.iteritems(settings.readme_files):
            shutil.copyfile(os.path.join(settings.share_dir, "preupgrade", key),
                            os.path.join(self.conf.result_dir, val))
示例#4
0
    def prepare_apply_directories(self):
        """Used for preparation of directories during remedation"""

        check_or_create_temp_dir(self.conf.result_dir)