From eb622bae0a9f4b015e25e8d1a10ccd8a412ca743 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 20 Mar 2024 19:48:17 -0700 Subject: [PATCH] ruff: Fix S605 Starting a process with a shell. Signed-off-by: Anders Kaseorg --- tools/lib/provision.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/lib/provision.py b/tools/lib/provision.py index 154958b97f..649a783db1 100755 --- a/tools/lib/provision.py +++ b/tools/lib/provision.py @@ -275,11 +275,16 @@ def install_yum_deps(deps_to_install: List[str]) -> None: # Requires: perl(IPC::Run) yum_extra_flags: List[str] = [] if vendor == "rhel": - exitcode, subs_status = subprocess.getstatusoutput("sudo subscription-manager status") - if exitcode == 1: + proc = subprocess.run( + ["sudo", "subscription-manager", "status"], + stdout=subprocess.PIPE, + text=True, + check=False, + ) + if proc.returncode == 1: # TODO this might overkill since `subscription-manager` is already # called in setup-yum-repo - if "Status" in subs_status: + if "Status" in proc.stdout: # The output is well-formed yum_extra_flags = ["--skip-broken"] else: