2021-08-31 10:54:15 +00:00
|
|
|
import logging
|
|
|
|
|
|
|
|
from subiquity.client.controller import SubiquityTuiController
|
|
|
|
from subiquity.common.types import WSLConfigurationBase
|
|
|
|
from system_setup.ui.views.wslconfbase import WSLConfigurationBaseView
|
|
|
|
|
2022-02-25 10:31:06 +00:00
|
|
|
log = logging.getLogger("system_setup.client.controllers.wslconfbase")
|
2021-08-31 10:54:15 +00:00
|
|
|
|
2021-08-31 11:26:49 +00:00
|
|
|
|
2021-08-31 10:54:15 +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 [
|
2021-10-04 10:55:25 +00:00
|
|
|
"automount_root",
|
|
|
|
"automount_options",
|
|
|
|
"network_generatehosts",
|
|
|
|
"network_generateresolvconf",
|
2023-07-25 21:26:25 +00:00
|
|
|
]
|
2021-10-04 10:55:25 +00:00
|
|
|
):
|
2021-10-05 01:38:10 +00:00
|
|
|
configuration = WSLConfigurationBase(**self.answers)
|
2021-08-31 10:54:15 +00:00
|
|
|
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()
|