answers support for installpath

This commit is contained in:
Michael Hudson-Doyle 2018-02-12 12:44:58 +13:00
parent 7bf9f2b2c1
commit b7fe9d6899
2 changed files with 11 additions and 0 deletions

View File

@ -2,6 +2,8 @@ Welcome:
lang: en_US
Keyboard:
layout: us
Installpath:
path: ubuntu
Network:
accept-default: yes
Filesystem:

View File

@ -29,6 +29,7 @@ class InstallpathController(BaseController):
def __init__(self, common):
super().__init__(common)
self.model = self.base_model.installpath
self.answers = self.all_answers.get("Installpath", {})
def installpath(self):
title = "Ubuntu %s"%(lsb_release.get_distro_information()['RELEASE'],)
@ -42,6 +43,14 @@ class InstallpathController(BaseController):
self.ui.set_header(title, excerpt)
self.ui.set_footer(footer)
self.ui.set_body(InstallpathView(self.model, self))
if 'path' in self.answers:
path = self.answers['path']
self.model.path = path
if path == 'ubuntu':
self.install_ubuntu()
else:
self.model.update(self.answers)
self.signal.emit_signal('next-screen')
default = installpath