From 44fe5a55db85160aa9658b6dbc2c37eb8d352176 Mon Sep 17 00:00:00 2001 From: Alex Burr Date: Wed, 12 Sep 2018 16:40:26 +0100 Subject: [PATCH] In gui mode progress.relaunch is ineffective in scenarios.py we need to raise an exception instead. --- kano_updater/commands/install.py | 6 ++++-- kano_updater/scenarios.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/kano_updater/commands/install.py b/kano_updater/commands/install.py index 47876801..9c250353 100644 --- a/kano_updater/commands/install.py +++ b/kano_updater/commands/install.py @@ -308,7 +308,8 @@ def install_standard(progress, status): try: preup.run(progress) except Relaunch: - raise + progress.relaunch() + return False except Exception as err: logger.error("The pre-update scenarios failed.") logger.error(err.encode('utf-8')) @@ -324,7 +325,8 @@ def install_standard(progress, status): postup.run(progress) except Relaunch: bump_system_version() - raise + progress.relaunch() + return False except Exception as err: logger.error("The post-update scenarios failed.") logger.error(err.encode('utf-8')) diff --git a/kano_updater/scenarios.py b/kano_updater/scenarios.py index 001c1d09..a3f4eee3 100644 --- a/kano_updater/scenarios.py +++ b/kano_updater/scenarios.py @@ -23,6 +23,7 @@ from kano_updater.utils import install, remove_user_files, update_failed, \ purge, rclocal_executable, migrate_repository, get_users, run_for_every_user from kano_updater.paths import PYLIBS_DIR, PYFALLBACK_DIR +from kano_updater.progress import Relaunch SOURCES_DIR = '/etc/apt/sources.list.d' @@ -1060,7 +1061,7 @@ def beta_3_15_0_to_beta_3_16_0(self, progress): apt_handle = AptWrapper.get_instance() apt_handle.refresh_instance() apt_handle.update(progress) - progress.relaunch() + raise Relaunch() def beta_3_16_0_to_beta_4_0_0(self, dummy_progress): ''' 4.0.0 is the first Debian Stretch version. All the work for