2021-07-02 08:26:21 +00:00
|
|
|
# Copyright 2021 Canonical, Ltd.
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Affero General Public License as
|
|
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
|
|
# License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Affero General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2021-08-31 10:03:01 +00:00
|
|
|
from subiquity.server.server import SubiquityServer
|
2021-09-01 08:50:56 +00:00
|
|
|
from system_setup.models.system_setup import SystemSetupModel
|
|
|
|
from subiquity.models.subiquity import ModelNames
|
|
|
|
|
2021-08-31 10:03:01 +00:00
|
|
|
import os
|
2021-08-19 15:42:06 +00:00
|
|
|
|
|
|
|
|
2021-09-01 08:50:56 +00:00
|
|
|
INSTALL_MODEL_NAMES = ModelNames({
|
|
|
|
"locale",
|
|
|
|
"wslconfbase",
|
|
|
|
},
|
|
|
|
wsl_setup={
|
|
|
|
"identity",
|
|
|
|
},
|
|
|
|
wsl_configuration={
|
|
|
|
"wslconfadvanced",
|
|
|
|
})
|
|
|
|
|
|
|
|
POSTINSTALL_MODEL_NAMES = ModelNames({})
|
|
|
|
|
|
|
|
|
2021-08-31 10:03:01 +00:00
|
|
|
class SystemSetupServer(SubiquityServer):
|
2021-08-19 15:42:06 +00:00
|
|
|
|
2021-07-02 08:26:21 +00:00
|
|
|
from system_setup.server import controllers as controllers_mod
|
|
|
|
controllers = [
|
|
|
|
"Reporting",
|
|
|
|
"Error",
|
|
|
|
"Locale",
|
|
|
|
"Identity",
|
2021-08-31 10:54:15 +00:00
|
|
|
"WSLConfigurationBase",
|
|
|
|
"WSLConfigurationAdvanced",
|
2021-08-31 10:07:20 +00:00
|
|
|
"Configure",
|
|
|
|
"Late",
|
2021-08-31 13:43:35 +00:00
|
|
|
"SetupShutdown",
|
2021-07-22 16:49:12 +00:00
|
|
|
]
|
|
|
|
|
2021-09-01 08:44:37 +00:00
|
|
|
supported_variants = ["wsl_setup", "wsl_configuration"]
|
|
|
|
|
2021-07-02 08:26:21 +00:00
|
|
|
def make_model(self):
|
|
|
|
root = '/'
|
|
|
|
if self.opts.dry_run:
|
|
|
|
root = os.path.abspath('.subiquity')
|
2021-09-01 08:50:56 +00:00
|
|
|
return SystemSetupModel(root, INSTALL_MODEL_NAMES, POSTINSTALL_MODEL_NAMES)
|