From b86f4066f4c97d6ff0c9bedafa34e7ac6a00b553 Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Wed, 10 Apr 2024 11:02:09 -0600 Subject: [PATCH] chore: Remove obsolete nose workaround --- cloudinit/util.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/cloudinit/util.py b/cloudinit/util.py index b5cdf319f39..44435ccf7e0 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -1798,17 +1798,10 @@ def get_config_logfiles(cfg): return list(set(logs + rotated_logs)) -def logexc(log, msg, *args, log_level: int = logging.WARNING) -> None: +def logexc( + log, msg, *args, log_level: int = logging.WARNING, exc_info=True +) -> None: log.log(log_level, msg, *args) - - # Debug gets the full trace. However, nose has a bug whereby its - # logcapture plugin doesn't properly handle the case where there is no - # actual exception. To avoid tracebacks during the test suite then, we'll - # do the actual exc_info extraction here, and if there is no exception in - # flight, we'll just pass in None. - exc_info = sys.exc_info() - if exc_info == (None, None, None): - exc_info = None # type: ignore log.debug(msg, exc_info=exc_info, *args)