From 4344abcb757eda998e5fcea657078d375b2a2043 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 17 Jan 2025 05:37:40 +0100 Subject: [PATCH] fix: avoid os.system --- src/aleph_client/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/aleph_client/utils.py b/src/aleph_client/utils.py index 38ba7136..ef8cf839 100644 --- a/src/aleph_client/utils.py +++ b/src/aleph_client/utils.py @@ -5,6 +5,7 @@ import logging import os import re +import subprocess from functools import partial, wraps from pathlib import Path from shutil import make_archive @@ -44,7 +45,7 @@ def create_archive(path: Path) -> tuple[Path, Encoding]: if settings.CODE_USES_SQUASHFS: logger.debug("Creating squashfs archive...") archive_path = Path(f"{path}.squashfs") - os.system(f"mksquashfs {path} {archive_path} -noappend") + subprocess.check_call(["/usr/bin/mksquashfs", path, archive_path, "-noappend"]) assert archive_path.is_file() return archive_path, Encoding.squashfs else: