From 8042bcd115a3af657f44a23f3628c532f719e247 Mon Sep 17 00:00:00 2001 From: Petr Hracek Date: Mon, 1 Jul 2024 09:47:40 +0200 Subject: [PATCH] Enable print run_command on request (#72) Signed-off-by: Petr "Stone" Hracek --- container_ci_suite/utils.py | 5 ++++- setup.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/container_ci_suite/utils.py b/container_ci_suite/utils.py index 8429ce8..fd74f57 100644 --- a/container_ci_suite/utils.py +++ b/container_ci_suite/utils.py @@ -139,6 +139,7 @@ def run_command( return_output: bool = True, ignore_error: bool = False, shell: bool = True, + debug: bool = False, **kwargs, ): """ @@ -148,9 +149,11 @@ def run_command( :param return_output: bool, return output of the command :param ignore_error: bool, do not fail in case nonzero return code :param shell: bool, run command in shell + :param debug: bool, print command in shell, default is suppressed :return: None or str """ - logger.debug(f"command: {cmd}") + if debug: + logger.debug(f"command: {cmd}") try: if return_output: return subprocess.check_output( diff --git a/setup.py b/setup.py index a1cc153..bb622b7 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ def get_requirements(): description='A python3 container CI tool for testing images.', long_description=long_description, long_description_content_type='text/markdown', - version="0.2.2", + version="0.2.3", keywords='tool,containers,images,tests', packages=find_packages(exclude=["tests"]), url="https://github.com/sclorg/container-ci-suite",