Merge pull request #1362 from ogayot/fde-curtin-application-state
meta/status: replace POST_WAIT and POST_RUNNING by generic states
This commit is contained in:
commit
c8a5292608
|
@ -56,16 +56,27 @@ class ErrorReportRef:
|
|||
|
||||
|
||||
class ApplicationState(enum.Enum):
|
||||
""" Represents the state of the application at a given time. """
|
||||
|
||||
# States reported during the initial stages of the installation.
|
||||
STARTING_UP = enum.auto()
|
||||
CLOUD_INIT_WAIT = enum.auto()
|
||||
EARLY_COMMANDS = enum.auto()
|
||||
WAITING = enum.auto()
|
||||
|
||||
# State reported once before starting destructive actions.
|
||||
NEEDS_CONFIRMATION = enum.auto()
|
||||
|
||||
# States reported during installation. This sequence should be expected
|
||||
# multiple times until we reach the late stages.
|
||||
WAITING = enum.auto()
|
||||
RUNNING = enum.auto()
|
||||
POST_WAIT = enum.auto()
|
||||
POST_RUNNING = enum.auto()
|
||||
|
||||
# States reported while unattended-upgrades is running.
|
||||
# TODO: check if these should be dropped in favor of RUNNING.
|
||||
UU_RUNNING = enum.auto()
|
||||
UU_CANCELLING = enum.auto()
|
||||
|
||||
# Final state
|
||||
DONE = enum.auto()
|
||||
ERROR = enum.auto()
|
||||
EXITED = enum.auto()
|
||||
|
|
|
@ -168,11 +168,11 @@ class InstallController(SubiquityController):
|
|||
await self.curtin_install(
|
||||
context=context, source='cp://' + for_install_path)
|
||||
|
||||
self.app.update_state(ApplicationState.POST_WAIT)
|
||||
self.app.update_state(ApplicationState.WAITING)
|
||||
|
||||
await self.model.wait_postinstall()
|
||||
|
||||
self.app.update_state(ApplicationState.POST_RUNNING)
|
||||
self.app.update_state(ApplicationState.RUNNING)
|
||||
|
||||
await self.postinstall(context=context)
|
||||
|
||||
|
|
|
@ -290,7 +290,7 @@ class TestFlow(TestAPI):
|
|||
"token": "a1b2c3d4e6f7g8h9I0K1",
|
||||
}
|
||||
await inst.post('/ubuntu_pro', ua_params)
|
||||
for state in 'RUNNING', 'POST_WAIT', 'POST_RUNNING', 'UU_RUNNING':
|
||||
for state in 'RUNNING', 'WAITING', 'RUNNING', 'UU_RUNNING':
|
||||
await inst.get('/meta/status', cur=state)
|
||||
|
||||
@timeout()
|
||||
|
|
|
@ -156,12 +156,6 @@ class ProgressView(BaseView):
|
|||
elif state == ApplicationState.RUNNING:
|
||||
self.title = _("Installing system")
|
||||
btns = [self.view_log_btn]
|
||||
elif state == ApplicationState.POST_WAIT:
|
||||
self.title = _("Installing system")
|
||||
btns = [self.view_log_btn]
|
||||
elif state == ApplicationState.POST_RUNNING:
|
||||
self.title = _("Installing system")
|
||||
btns = [self.view_log_btn]
|
||||
elif state == ApplicationState.UU_RUNNING:
|
||||
self.title = _("Install complete!")
|
||||
self.reboot_btn.base_widget.set_label(
|
||||
|
|
|
@ -384,9 +384,9 @@ class ConfigureController(SubiquityController):
|
|||
|
||||
await self.model.wait_postinstall()
|
||||
|
||||
self.app.update_state(ApplicationState.POST_WAIT)
|
||||
self.app.update_state(ApplicationState.WAITING)
|
||||
|
||||
self.app.update_state(ApplicationState.POST_RUNNING)
|
||||
self.app.update_state(ApplicationState.RUNNING)
|
||||
|
||||
variant = self.app.variant
|
||||
root_dir = self.model.root
|
||||
|
|
Loading…
Reference in New Issue