subiquity/system_setup/client/controllers/wslconfbase.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1.2 KiB
Python
Raw Normal View History

import logging
from subiquity.client.controller import SubiquityTuiController
from subiquity.common.types import WSLConfigurationBase
from system_setup.ui.views.wslconfbase import WSLConfigurationBaseView
log = logging.getLogger("system_setup.client.controllers.wslconfbase")
2021-08-31 11:26:49 +00:00
class WSLConfigurationBaseController(SubiquityTuiController):
endpoint_name = "wslconfbase"
async def make_ui(self):
data = await self.endpoint.GET()
return WSLConfigurationBaseView(self, data)
def run_answers(self):
if all(
elem in self.answers
for elem in [
"automount_root",
"automount_options",
"network_generatehosts",
"network_generateresolvconf",
2023-07-25 21:26:25 +00:00
]
):
configuration = WSLConfigurationBase(**self.answers)
self.done(configuration)
def done(self, configuration_data):
log.debug(
"WSLConfigurationBaseController.done next_screen user_spec=%s",
configuration_data,
)
self.app.next_screen(self.endpoint.POST(configuration_data))
def cancel(self):
self.app.prev_screen()