from teuthology.config import config
from teuthology.exceptions import MaxWhileTries
+from six import reraise
+
log = logging.getLogger(__name__)
@contextlib.contextmanager
# Don't rely on sys.exc_info() still containing
# the right information. Another exception may
# have been raised and caught by an exit method
- raise exc[0], exc[1], exc[2]
+ reraise(*exc)
class safe_while(object):
Miscellaneous teuthology functions.
Used by other modules, but mostly called from tasks.
"""
-
import argparse
import os
import logging
from teuthology.contextutil import safe_while
from teuthology.orchestra.opsys import DEFAULT_OS_VERSION
+from six import reraise
+
log = logging.getLogger(__name__)
import datetime
exc_info = sys.exc_info()
log.exception('Saw exception from %s.%s', daemon.role, daemon.id_)
if exc_info != (None, None, None):
- raise exc_info[0], exc_info[1], exc_info[2]
+ reraise(*exc_info)
def get_system_type(remote, distro=False, version=False):