aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2021-06-23 12:33:23 -0400
committerJake Hunsaker <jhunsake@redhat.com>2021-06-30 08:42:06 -0400
commitee6ee9c4ae5b22e693aa832146e0555da4af4fcc (patch)
treef48ffc01105775c637e76f56b2c3e79fc989f235
parent122d2784b7898ab6efc198105e0755600318bb68 (diff)
downloadsos-ee6ee9c4ae5b22e693aa832146e0555da4af4fcc.tar.gz
[tests] Catch unexpected exceptions that can't be inspected
If we get an exception we aren't expecting and can't investigate due to a missing `CmdResult` object being attached to the raised exception, simply re-raise that exception rather than failing on trying to inspect a non-existing object.
-rw-r--r--tests/sos_tests.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/sos_tests.py b/tests/sos_tests.py
index 892309b7..cae65431 100644
--- a/tests/sos_tests.py
+++ b/tests/sos_tests.py
@@ -120,6 +120,9 @@ class BaseSoSTest(Test):
try:
self.cmd_output = process.run(exec_cmd, timeout=self.sos_timeout)
except Exception as err:
+ if not hasattr(err, 'result'):
+ # can't inspect the exception raised, just bail out
+ raise
if self._exception_expected:
self.cmd_output = err.result
else: