do not call setup_autoinstall as part of __init__

This commit is contained in:
Michael Hudson-Doyle 2020-10-09 12:47:23 +13:00
parent cac81ccd99
commit 7d22e299bd
2 changed files with 9 additions and 6 deletions

View File

@ -43,7 +43,6 @@ class SubiquityController(BaseController):
super().__init__(app)
self.autoinstall_applied = False
self.context.set('controller', self)
self.setup_autoinstall()
def interactive(self):
return False
@ -109,6 +108,9 @@ class RepeatedController(RepeatedController):
super().__init__(orig, index)
self.autoinstall_applied = False
def setup_autoinstall(self):
pass
async def apply_autoinstall_config(self):
await self.orig.apply_autoinstall_config(index=self.index)

View File

@ -257,12 +257,12 @@ class Subiquity(TuiApplication):
print(_("press enter to start a shell"))
input()
os.system("cd / && bash")
self.controllers.load("Reporting")
self.controllers.Reporting.start()
self.controllers.load("Error")
with self.context.child("core_validation", level="INFO"):
jsonschema.validate(self.autoinstall_config, self.base_schema)
self.controllers.load("Early")
self.controllers.Reporting.setup_autoinstall()
self.controllers.Early.setup_autoinstall()
self.controllers.Error.setup_autoinstall()
if self.controllers.Early.cmds:
stamp_file = self.state_path("early-commands")
if our_tty != primary_tty:
@ -327,6 +327,7 @@ class Subiquity(TuiApplication):
break
async def start(self):
self.controllers.load_all()
await self.connect()
if self.opts.autoinstall is not None:
await self.load_autoinstall_config()