Improve autoinstall schema for third-party drivers
The autoinstall data for the drivers was only constituted of a boolean, e.g.: drivers: true or drivers: false It was not immediately clear that the boolean value meant (install/don't install the drivers). We now store the boolean in the "install" sub-element instead, e.g.: drivers: - install: true drivers: - install: false Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
This commit is contained in:
parent
e26f35ad10
commit
43f71a02be
|
@ -396,7 +396,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"drivers": {
|
"drivers": {
|
||||||
"type": "boolean"
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"install": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"timezone": {
|
"timezone": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
|
@ -33,17 +33,25 @@ class DriversController(SubiquityController):
|
||||||
|
|
||||||
autoinstall_key = model_name = "drivers"
|
autoinstall_key = model_name = "drivers"
|
||||||
autoinstall_schema = {
|
autoinstall_schema = {
|
||||||
'type': 'boolean',
|
'type': 'object',
|
||||||
|
'properties': {
|
||||||
|
'install': {
|
||||||
|
'type': 'boolean',
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
autoinstall_default = False
|
autoinstall_default = {"install": False}
|
||||||
|
|
||||||
has_drivers = None
|
has_drivers = None
|
||||||
|
|
||||||
def make_autoinstall(self):
|
def make_autoinstall(self):
|
||||||
return self.model.do_install
|
return {
|
||||||
|
"install": self.model.do_install,
|
||||||
|
}
|
||||||
|
|
||||||
def load_autoinstall_data(self, data):
|
def load_autoinstall_data(self, data):
|
||||||
self.model.do_install = data
|
if data is not None and "install" in data:
|
||||||
|
self.model.do_install = data["install"]
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
self._wait_apt = asyncio.Event()
|
self._wait_apt = asyncio.Event()
|
||||||
|
|
Loading…
Reference in New Issue