tests/ci/compress_files.py: fix pylint warnings

This commit is contained in:
Azat Khuzhin 2021-10-27 10:03:23 +03:00
parent d1c49bbdcb
commit e581cdb933

View File

@ -32,18 +32,18 @@ def compress_fast(path, archive_path, exclude=None):
else: else:
path += "/.." path += "/.."
cmd = "tar {} {} -cf {} -C {} {}".format(pigz_part, exclude_part, archive_path, path, fname) cmd = "tar {} {} -cf {} -C {} {}".format(pigz_part, exclude_part, archive_path, path, fname)
logging.debug("compress_fast cmd:{}".format(cmd)) logging.debug("compress_fast cmd: %s", cmd)
subprocess.check_call(cmd, shell=True) subprocess.check_call(cmd, shell=True)
def decompress_fast(archive_path, result_path=None): def decompress_fast(archive_path, result_path=None):
pigz_part = '' pigz_part = ''
if os.path.exists('/usr/bin/pigz'): if os.path.exists('/usr/bin/pigz'):
logging.info("pigz found, will compress and decompress faster ('{}' -> '{}')".format(archive_path, result_path)) logging.info("pigz found, will compress and decompress faster ('%s' -> '%s')", archive_path, result_path)
pigz_part = "--use-compress-program='pigz'" pigz_part = "--use-compress-program='pigz'"
else: else:
pigz_part = '-z' pigz_part = '-z'
logging.info("no pigz, decompressing with default tar ('{}' -> '{}')".format(archive_path, result_path)) logging.info("no pigz, decompressing with default tar ('%s' -> '%s')", archive_path, result_path)
if result_path is None: if result_path is None:
subprocess.check_call("tar {} -xf {}".format(pigz_part, archive_path), shell=True) subprocess.check_call("tar {} -xf {}".format(pigz_part, archive_path), shell=True)