diff --git a/snapcraft.yaml b/snapcraft.yaml index 922cb9bb..cce82559 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -134,7 +134,7 @@ parts: bin/subiquity-service: usr/bin/subiquity-service bin/subiquity-server: usr/bin/subiquity-server bin/subiquity-cmd: usr/bin/subiquity-cmd - $CRAFT_PART_BUILD/system_setup/ubuntu-wsl-setup: bin/ubuntu-wsl-setup + $CRAFT_PROJECT_DIR/system_setup/ubuntu-wsl-setup: bin/ubuntu-wsl-setup build-attributes: - enable-patchelf diff --git a/subiquity/client/controllers/filesystem.py b/subiquity/client/controllers/filesystem.py index 27d7868f..d035f715 100644 --- a/subiquity/client/controllers/filesystem.py +++ b/subiquity/client/controllers/filesystem.py @@ -241,7 +241,7 @@ class FilesystemController(SubiquityTuiController, FilesystemManipulator): clean_suffix='vg'): pass elif action['action'] == 'done': - if not self.ui.body.done.enabled: + if not self.ui.body.done_btn.enabled: raise Exception("answers did not provide complete fs config") await self.app.confirm_install() self.finish() diff --git a/subiquity/common/api/server.py b/subiquity/common/api/server.py index a3c60cd6..5a4ea2a8 100644 --- a/subiquity/common/api/server.py +++ b/subiquity/common/api/server.py @@ -60,6 +60,27 @@ def trim(text): return text +async def check_controllers_started(definition, controller, request): + if not hasattr(controller, 'app'): + return + + if getattr(definition, 'allowed_before_start', False): + return + + # Most endpoints should not be responding to requests + # before the controllers have started, that's just bound to + # be a big pool of timing bugs that we want nothing to do + # with. A few chosen methods should be safe, so allow + # those to opt-in. Everybody else blocks until the + # controllers complete their start(). + if controller.app.controllers_have_started.is_set(): + return + + log.debug(f'{request.path} waiting on start') + await controller.app.controllers_have_started.wait() + log.debug(f'{request.path} resuming') + + def _make_handler(controller, definition, implementation, serializer, serialize_query_args): def_sig = inspect.signature(definition) @@ -134,18 +155,8 @@ def _make_handler(controller, definition, implementation, serializer, args['context'] = context if 'request' in impl_params: args['request'] = request - if not getattr( - definition, 'allowed_before_start', False): - # Most endpoints should not be responding to requests - # before the controllers have started, that's just bound to - # be a big pool of timing bugs that we want nothing to do - # with. A few chosen methods should be safe, so allow - # those to opt-in. Everybody else blocks until the - # controllers complete their start(). - if not controller.app.controllers_have_started.is_set(): - log.debug(f'{request.path} waiting on start') - await controller.app.controllers_have_started.wait() - log.debug(f'{request.path} resuming') + await check_controllers_started( + definition, controller, request) result = await implementation(**args) resp = web.json_response( serializer.serialize(def_ret_ann, result), diff --git a/subiquity/server/controllers/ad.py b/subiquity/server/controllers/ad.py index 650ed112..daf8606f 100644 --- a/subiquity/server/controllers/ad.py +++ b/subiquity/server/controllers/ad.py @@ -128,7 +128,11 @@ class AdController(SubiquityController): def interactive(self): # Since we don't accept the domain admin password in the autoinstall # file, this cannot be non-interactive. - return True + + # HACK: the interactive behavior is causing some autoinstalls with + # desktop to block. + # return True + return False def __init__(self, app): super().__init__(app) diff --git a/subiquity/server/controllers/network.py b/subiquity/server/controllers/network.py index a2b7059f..5a3b0a76 100644 --- a/subiquity/server/controllers/network.py +++ b/subiquity/server/controllers/network.py @@ -364,7 +364,7 @@ class NetworkController(BaseNetworkController, SubiquityController): if state == WLANSupportInstallState.INSTALLING: self.pending_wlan_devices.add(dev) return - elif state in [WLANSupportInstallState.FAILED. + elif state in [WLANSupportInstallState.FAILED, WLANSupportInstallState.NOT_AVAILABLE]: return # WLANSupportInstallState.DONE falls through diff --git a/subiquity/ui/views/filesystem/filesystem.py b/subiquity/ui/views/filesystem/filesystem.py index 3ea801f0..0c9ab2a4 100644 --- a/subiquity/ui/views/filesystem/filesystem.py +++ b/subiquity/ui/views/filesystem/filesystem.py @@ -495,10 +495,10 @@ class FilesystemView(BaseView): return TablePile(rows) def _build_buttons(self): - self.done = Toggleable(done_btn(_("Done"), on_press=self.done)) + self.done_btn = Toggleable(done_btn(_("Done"), on_press=self.done)) return [ - self.done, + self.done_btn, reset_btn(_("Reset"), on_press=self.reset), back_btn(_("Back"), on_press=self.cancel), ] @@ -524,7 +524,7 @@ class FilesystemView(BaseView): # This is an awful hack, actual thinking required: self.lb.base_widget._select_first_selectable() can_install = self.model.can_install() - self.done.enabled = can_install + self.done_btn.enabled = can_install if self.showing_guidance: del self.frame.contents[0] guidance = self._guidance()