diff --git a/subiquity/controller.py b/subiquity/controller.py index 1d3ecb0e..515fcac5 100644 --- a/subiquity/controller.py +++ b/subiquity/controller.py @@ -29,6 +29,15 @@ class SubiquityController(BaseController): def deserialize(self, state): self.configured() + def interactive(self): + if not self.app.autoinstall_config: + return True + i_sections = self.app.autoinstall_config.get( + 'interactive-sections', []) + if '*' in i_sections or self.autoinstall_key in i_sections: + return True + return False + def configured(self): """Let the world know that this controller's model is now configured. """ @@ -44,7 +53,11 @@ class NoUIController(SubiquityController): def cancel(self): pass + def interactive(self): + return False + class RepeatedController(RepeatedController): - pass + def interactive(self): + return self.orig.interactive() diff --git a/subiquity/controllers/installprogress.py b/subiquity/controllers/installprogress.py index 754bcd7a..37f20672 100644 --- a/subiquity/controllers/installprogress.py +++ b/subiquity/controllers/installprogress.py @@ -112,6 +112,9 @@ class InstallProgressController(SubiquityController): self.tb_extractor = TracebackExtractor() self.curtin_context = None + def interactive(self): + return self.app.interactive() + def start(self): self.install_task = schedule_task(self.install(self.context)) diff --git a/subiquity/core.py b/subiquity/core.py index 6dc1fb89..16c11cef 100644 --- a/subiquity/core.py +++ b/subiquity/core.py @@ -152,6 +152,11 @@ class Subiquity(Application): self.controllers.Reporting.report_finish_event( name, description, status, level) + def interactive(self): + if not self.autoinstall_config: + return True + return bool(self.autoinstall_config.get('interactive-sections')) + def select_initial_screen(self, index): super().select_initial_screen(index) for report in self.controllers.Error.reports: