Skip to content

Commit

Permalink
oem: check variant before waiting for apt configuration
Browse files Browse the repository at this point in the history
because if we add support for variant == 'core' (spoilers!), then apt
may never be configured.
  • Loading branch information
mwhudson committed Jul 18, 2023
1 parent 00102ec commit 19134b1
Showing 1 changed file with 9 additions and 2 deletions.
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 19134b1

Please sign in to comment.