Skip to content

Commit

Permalink
chore: Remove obsolete nose workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
holmanb authored and blackboxsw committed Apr 16, 2024
1 parent b9aff94 commit b86f406
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions cloudinit/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit b86f406

Please sign in to comment.