From e5988165531a8a4a5355a017ac67687e9488c2c8 Mon Sep 17 00:00:00 2001 From: Jose Castillo Date: Fri, 1 Nov 2024 09:35:00 +0000 Subject: [PATCH] [collect] Fix exception while parsing sos help While parsing the output of 'sos report -l', we were attempting to split an empty line, and getting the following exception: [:_regex_sos_help] Error parsing sos help: list index out of range Related: #3827 Signed-off-by: Jose Castillo --- sos/collector/sosnode.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sos/collector/sosnode.py b/sos/collector/sosnode.py index 0a3effaa4d..0af004f6cd 100644 --- a/sos/collector/sosnode.py +++ b/sos/collector/sosnode.py @@ -367,7 +367,8 @@ def _regex_sos_help(self, regex, sosinfo, is_list=False): for line in result.splitlines(): if not is_list: try: - res.append(line.split()[0]) + if ls := line.split(): + res.append(ls[0]) except Exception as err: self.log_debug(f"Error parsing sos help: {err}") else: