Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
holmanb committed Jan 7, 2025
1 parent a3ae78e commit 0d289e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cloudinit/signal_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0d289e0

Please sign in to comment.