From ee6ee9c4ae5b22e693aa832146e0555da4af4fcc Mon Sep 17 00:00:00 2001 From: Jake Hunsaker Date: Wed, 23 Jun 2021 12:33:23 -0400 Subject: [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. --- tests/sos_tests.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/sos_tests.py') 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: -- cgit