From c9fb39c42cbddd323f4c698a0ccd5e2b2c979c23 Mon Sep 17 00:00:00 2001 From: Jerry Date: Thu, 1 Jul 2021 14:55:49 +0800 Subject: [PATCH] fix bugs --- src/pacroller/main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pacroller/main.py b/src/pacroller/main.py index 89c7a4a..eef70fe 100644 --- a/src/pacroller/main.py +++ b/src/pacroller/main.py @@ -280,17 +280,15 @@ def main() -> None: logger.handlers[0].setLevel(logging.INFO) locale_set() interactive = args.interactive == "on" or not (args.interactive == 'off' or not isatty(0)) - send_mail = MailSender().send_text_plain if not interactive else lambda *_, **_: None logger.debug(f"interactive questions {'enabled' if interactive else 'disabled'}") + send_mail = MailSender().send_text_plain if not interactive else lambda *_: None if args.action == 'run': if getuid() != 0: logger.error('you need to be root') exit(1) if prev_err := has_previous_error(): - _err = f'Cannot continue, a previous error {prev_err} is still present. Please resolve this issue and run reset.' - logger.error(_err) - send_mail(_err) + logger.error(f'Cannot continue, a previous error {prev_err} is still present. Please resolve this issue and run reset.') exit(2) if SYSTEMD: if _s := is_system_failed():