Merge pull request #1607 from dbungert/lunar-2023-03-21

Lunar 2023 03 21
This commit is contained in:
Dan Bungert 2023-03-21 19:02:01 -06:00 committed by GitHub
commit 49bf10022c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 34 additions and 19 deletions

View File

@ -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

View File

@ -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()

View File

@ -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),

View File

@ -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)

View File

@ -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

View File

@ -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()