Skip to content

Commit

Permalink
In gui mode progress.relaunch is ineffective in scenarios.py
Browse files Browse the repository at this point in the history
we need to raise an exception instead.
  • Loading branch information
Ealdwulf committed Sep 18, 2018
1 parent 3ad1008 commit 44fe5a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions kano_updater/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand All @@ -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'))
Expand Down
3 changes: 2 additions & 1 deletion kano_updater/scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 44fe5a5

Please sign in to comment.