yandextank/core/tankcore.py
def __collect_file(self, filename, keep_original=False):
        """
        Move or copy single file to artifacts dir
        """
        dest = self.artifacts_dir + '/' + os.path.basename(filename)
        logger.debug("Collecting file: %s to %s", filename, dest)
        if not filename or not os.path.exists(filename):
            logger.warning("File not found to collect: %s", filename)
            return

        if os.path.exists(dest):
            # FIXME: 3 find a way to store artifacts anyway
            logger.warning("File already exists: %s", dest)
            return

        if keep_original:
            shutil.copy(filename, self.artifacts_dir)
        else:
            shutil.move(filename, self.artifacts_dir)

        os.chmod(dest, 0o644)
def __collect_file(self, filename, keep_original=False):
        dest = self.artifacts_dir + '/' + os.path.basename(filename)
        logger.debug("Collecting file: %s to %s", filename, dest)
        if not filename or not os.path.exists(filename):
            logger.warning("File not found to collect: %s", filename)
            return

        if os.path.exists(dest):
            # FIXME: 3 find a way to store artifacts anyway
            logger.warning("File already exists: %s", dest)
            return

        if keep_original:
            shutil.copy(filename, self.artifacts_dir)
        else:
            shutil.move(filename, self.artifacts_dir)

        os.chmod(dest, 0o644)
def __collect_file ( self , filename , keep_original = False ) : dest = self . artifacts_dir + '/' + os . path . basename ( filename ) logger . debug ( "Collecting file: %s to %s" , filename , dest ) if not filename or not os . path . exists ( filename ) : logger . warning ( "File not found to collect: %s" , filename ) return if os . path . exists ( dest ) : # FIXME: 3 find a way to store artifacts anyway logger . warning ( "File already exists: %s" , dest ) return if keep_original : shutil . copy ( filename , self . artifacts_dir ) else : shutil . move ( filename , self . artifacts_dir ) os . chmod ( dest , 0o644 )
Move or copy single file to artifacts dir
Move or copy single file to artifacts dir