From 678d8b74fd319d162bf7d8e415e6f17f9aa5b3c5 Mon Sep 17 00:00:00 2001 From: Mikhail Sandakov Date: Thu, 26 Sep 2024 10:33:24 +0300 Subject: [PATCH] Add information about interrupted conversion/dist-upgrade to stdout and motd --- pleskdistup/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pleskdistup/main.py b/pleskdistup/main.py index 348ac64..621c08f 100644 --- a/pleskdistup/main.py +++ b/pleskdistup/main.py @@ -321,6 +321,14 @@ def try_lock(lock_file: PathType) -> typing.Generator[bool, None, None]: def exit_signal_handler(signum, frame): # exit will trigger blocks finalization, so lockfile will be removed log.info(f"Received signal {signum}, going to exit...") + print(f"The dist-upgrade process was stopped by signal {signum}. Please use the `--revert` option before trying again.") + + motd.add_finish_ssh_login_message(""" +The dist-upgrade process was stopped by signal. +Please use the `--revert` option before trying again. +""") + motd.publish_finish_ssh_login_message() + sys.exit(1)