From 7ae1c2ba4a0786028abb951c7a23a8e11e2ed9b9 Mon Sep 17 00:00:00 2001 From: mhorky Date: Thu, 25 Jan 2024 13:58:50 +0100 Subject: [PATCH] Stop logging full lscpu output It doesn't make sense to be logging full output of lscpu output in the log file -- it doesn't bring any new information when investigating issues. Only when it is not possible to decode it into dictionary we should include the raw output. --- src/rhsmlib/facts/hwprobe.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/rhsmlib/facts/hwprobe.py b/src/rhsmlib/facts/hwprobe.py index b1ffb78551..d11b35cc7f 100644 --- a/src/rhsmlib/facts/hwprobe.py +++ b/src/rhsmlib/facts/hwprobe.py @@ -653,12 +653,10 @@ def _parse_lscpu_json_output(self, lscpu_env: Dict[str, str]) -> Dict[str, str]: log.warning("Failed to run 'lscpu --json': %s", e) return {} - log.debug("Parsing lscpu JSON: %s", output) - try: output_json: dict = json.loads(output) - except json.JSONDecodeError as e: - log.warning("Failed to load the lscpu JSON: %s", e) + except json.JSONDecodeError: + log.exception("Failed to load the lscpu JSON: %s", output) return {} try: