From 0d289e00325fea543675183fca34f8008db45235 Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Tue, 7 Jan 2025 12:07:54 -0700 Subject: [PATCH] update --- cloudinit/signal_handler.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cloudinit/signal_handler.py b/cloudinit/signal_handler.py index ab47b89cd31..e65ad1ae845 100644 --- a/cloudinit/signal_handler.py +++ b/cloudinit/signal_handler.py @@ -44,15 +44,15 @@ def default_handler(_num, _stack) -> None: def inspect_handler(sig: Union[int, Callable, None]) -> None: """inspect_handler() logs signal handler state""" - if sig == signal.SIG_DFL: - LOG.debug("Signal state [SIG_IGN] - previously ignored.") - elif sig == signal.SIG_IGN: + # only produce a log if the signal handler isn't in the expected default + # state: SIG_DFL + if sig == signal.SIG_IGN: LOG.info("Signal state [SIG_IGN] - previously ignored.") elif sig is None: LOG.info("Signal state [None] - previously not installed from Python.") elif callable(sig): LOG.info("Signal state [%s] - custom handler.", sig) - else: + elif sig != signal.SIG_DFL: # this should never happen, unless something in Python changes # https://docs.python.org/3/library/signal.html#signal.getsignal LOG.warning("Signal state [%s(%s)] - unknown", type(sig), sig)