diff options
Diffstat (limited to 'prometheus_pacman_exporter')
| -rw-r--r-- | prometheus_pacman_exporter/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/prometheus_pacman_exporter/__init__.py b/prometheus_pacman_exporter/__init__.py index 3e29849..0125187 100644 --- a/prometheus_pacman_exporter/__init__.py +++ b/prometheus_pacman_exporter/__init__.py @@ -135,12 +135,13 @@ def run_command( :param accepted_exit_codes: Exit codes considered successful. :return: Completed process with stdout and stderr captured. """ - debug("Running command", " ".join(command), err=True) + command_string = shlex.join(command) + debug("Running command", command_string, err=True) result = subprocess.run(command, capture_output=True, encoding="utf-8", check=False) if result.returncode not in accepted_exit_codes: error( - f"Command ({' '.join(command)}) failed with exit code {result.returncode}" + f"Command ({command_string}) failed with exit code:", str(result.returncode) ) if result.stderr: error("stderr:", result.stderr.strip()) |
