Don't log exit status if --operatornotify/level wasn't passed.

This commit is contained in:
voussoir 2021-08-22 19:50:04 -07:00
parent 9c880f2825
commit 81f81a6c24
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -178,6 +178,10 @@ def main_decorator(subject, *args, **kwargs):
def wrapper(main):
def wrapped(argv):
(context, argv) = main_log_context(argv, subject, *args, **kwargs)
if isinstance(context, contextlib.nullcontext):
return main(argv)
with context:
status = main(argv)
log.info('Program finished, returned %s.', status)