Skip to content

Commit

Permalink
[collect] Fix exception while parsing sos help
Browse files Browse the repository at this point in the history
While parsing the output of 'sos report -l', we
were attempting to split an empty line, and
getting the following exception:

[<ip address>:_regex_sos_help] Error parsing sos help: list index out of range

Related: #3827

Signed-off-by: Jose Castillo <[email protected]>
  • Loading branch information
jcastill committed Nov 1, 2024
1 parent 2aa4fcf commit 1a1252d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sos/collector/sosnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 line.split():
res.append(line.split()[0])
except Exception as err:
self.log_debug(f"Error parsing sos help: {err}")
else:
Expand Down

0 comments on commit 1a1252d

Please sign in to comment.