Skip to content

Commit

Permalink
Merge pull request #1725 from mwhudson/oem-no-wait-apt
Browse files Browse the repository at this point in the history
oem: check variant before waiting for apt configuration
  • Loading branch information
mwhudson authored Jul 18, 2023
2 parents 3fc3843 + 66823be commit 9268c92
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
5 changes: 4 additions & 1 deletion subiquity/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,10 @@ async def move_screen(self, increment, coro):

def show_confirm_install(self):
log.debug("showing InstallConfirmation over %s", self.ui.body)
self.add_global_overlay(InstallConfirmation(self))
overlay = InstallConfirmation(self)
self.add_global_overlay(overlay)
if self.answers.get('filesystem-confirmed', False):
overlay.ok(None)

async def _start_answers_for_view(
self, controller, view: Union[BaseView, Callable[[], BaseView]]):
Expand Down
6 changes: 3 additions & 3 deletions subiquity/client/controllers/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async def run_answers(self):
await asyncio.sleep(0.1)

if self.answers['tpm-default']:
await self.app.confirm_install()
self.app.answers['filesystem-confirmed'] = True
self.ui.body.done(self.ui.body.form)
if self.answers['guided']:
targets = self.ui.body.form.targets
Expand Down Expand Up @@ -149,7 +149,7 @@ async def run_answers(self):
}
self.ui.body.form.guided_choice.value = value
self.ui.body.done(None)
await self.app.confirm_install()
self.app.answers['filesystem-confirmed'] = True
while not isinstance(self.ui.body, FilesystemView):
await asyncio.sleep(0.1)
self.finish()
Expand Down Expand Up @@ -262,7 +262,7 @@ async def _answers_action(self, action):
elif action['action'] == 'done':
if not self.ui.body.done_btn.enabled:
raise Exception("answers did not provide complete fs config")
await self.app.confirm_install()
self.app.answers['filesystem-confirmed'] = True
self.finish()
else:
raise Exception("could not process action {}".format(action))
Expand Down
11 changes: 9 additions & 2 deletions subiquity/server/controllers/oem.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def __init__(self, app) -> None:
self.kernel_configured_event = asyncio.Event()

def start(self) -> None:
self._wait_confirmation = asyncio.Event()
self.app.hub.subscribe(
InstallerChannels.INSTALL_CONFIRMED,
self._wait_confirmation.set)
self._wait_apt = asyncio.Event()
self.app.hub.subscribe(
InstallerChannels.APT_CONFIGURED,
Expand Down Expand Up @@ -121,8 +125,8 @@ async def wants_oem_kernel(self, pkgname: str,

@with_context()
async def load_metapackages_list(self, context) -> None:
with context.child("wait_apt"):
await self._wait_apt.wait()
with context.child("wait_confirmation"):
await self._wait_confirmation.wait()

# Only look for OEM meta-packages on supported variants and if we are
# not running core boot.
Expand All @@ -138,6 +142,9 @@ async def load_metapackages_list(self, context) -> None:
self.model.metapkgs = []
return

with context.child("wait_apt"):
await self._wait_apt.wait()

apt = self.app.controllers.Mirror.final_apt_configurer
try:
async with apt.overlay() as d:
Expand Down

0 comments on commit 9268c92

Please sign in to comment.