From 7303d688478626857895a7e768af08b0c6d041e2 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 9 Oct 2020 13:39:09 +1300 Subject: [PATCH] introduce a couple more installstates --- subiquity/common/types.py | 2 ++ subiquity/controllers/installprogress.py | 10 ++++------ subiquity/ui/views/installprogress.py | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/subiquity/common/types.py b/subiquity/common/types.py index ec5e6813..16538cb0 100644 --- a/subiquity/common/types.py +++ b/subiquity/common/types.py @@ -166,6 +166,8 @@ class InstallState(enum.Enum): NOT_STARTED = enum.auto() NEEDS_CONFIRMATION = enum.auto() RUNNING = enum.auto() + POST_WAIT = enum.auto() + POST_RUNNING = enum.auto() UU_RUNNING = enum.auto() UU_CANCELLING = enum.auto() DONE = enum.auto() diff --git a/subiquity/controllers/installprogress.py b/subiquity/controllers/installprogress.py index dc3f80b4..70ba9fe0 100644 --- a/subiquity/controllers/installprogress.py +++ b/subiquity/controllers/installprogress.py @@ -291,9 +291,6 @@ class InstallProgressController(SubiquityTuiController): log.debug('curtin_install completed: %s', cp.returncode) - self.update_state(InstallState.DONE) - log.debug('After curtin install OK') - def cancel(self): pass @@ -316,15 +313,16 @@ class InstallProgressController(SubiquityTuiController): await self.curtin_install(context=context) + self.update_state(InstallState.POST_WAIT) + await asyncio.wait( {e.wait() for e in self.model.postinstall_events}) await self.drain_curtin_events(context=context) - await self.postinstall(context=context) + self.update_state(InstallState.POST_RUNNING) - self.ui.set_header(_("Installation complete!")) - self.progress_view.set_status(_("Finished install!")) + await self.postinstall(context=context) if self.model.network.has_network: self.update_state(InstallState.UU_RUNNING) diff --git a/subiquity/ui/views/installprogress.py b/subiquity/ui/views/installprogress.py index aab7e14f..0b2dacb1 100644 --- a/subiquity/ui/views/installprogress.py +++ b/subiquity/ui/views/installprogress.py @@ -146,6 +146,12 @@ class ProgressView(BaseView): elif state == InstallState.RUNNING: self.title = _("Installing system") btns = [self.view_log_btn] + elif state == InstallState.POST_WAIT: + self.title = _("Installing system") + btns = [self.view_log_btn] + elif state == InstallState.POST_RUNNING: + self.title = _("Installing system") + btns = [self.view_log_btn] elif state == InstallState.UU_RUNNING: self.title = _("Install complete!") self.reboot_btn.base_widget.set_label(