Skip to content

Commit

Permalink
[utilities] catch SoSTimeoutError in sos_get_command_output
Browse files Browse the repository at this point in the history
When calling collect_cmd_output and timeout is hit, SoSTimeoutError is
raised and never caught (until in plugin wrapper).

Resolves: #3331

Signed-off-by: Pavel Moravec <[email protected]>
  • Loading branch information
pmoravec committed Aug 9, 2023
1 parent 46794f4 commit c194ab4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sos/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ def _check_poller(proc):
_output.close()
if e.errno == errno.ENOENT:
return {'status': 127, 'output': "", 'truncated': ''}
elif isinstance(e, SoSTimeoutError):
return {'status': 124, 'output': reader.get_contents(),
'truncated': reader.is_full}
else:
raise e

Expand Down

0 comments on commit c194ab4

Please sign in to comment.