These errors are really errors in how the ISO is constructed, so logging
and ignoring seems more appropriate, compared to say encryption being
unavailable because the TPM is in lockout mode.
We only search for drivers if search_drivers is enabled in the source
screen. When testing in dry-run mode, we need to check the
search_drivers checkbox AND remember to pass the has-drivers debug flag.
I think it makes sense to consider drivers available by default in
dry-run mode.
This also means that OEM meta-packages are available by default (and
_should_ be installed automatically) in dry-run now.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
The ubuntu_drivers.list_drivers() method currently returns names of
drivers + name of OEM meta-packages.
We now define a new method to be used for the OEM meta-packages only.
For now, the has-drivers, no-drivers, run-drivers debug flags affect the
presence of the OEM meta-packages as well. Going forward, we should
define dry-run directives controlling drivers & OEM independently.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
The /drivers GET endpoint is supposed to have {"drivers": null} when the
list of drivers has not (yes) been retrieved.
However, this behavior got broken by the following patch:
66c82b322 drivers: query again list of drivers if the source variant changes
.. which resets the drivers variable to an empty list when querying the
list of drivers (this happens automatically when the user submits on the
source screen).
Therefore, instead of getting {"drivers": null}, we would get
{"drivers": []} which has a different meaning.
The patch also incorrectly declared the drivers variable in the
initializer (not taking None into account). The variable was actually
already declared as a class variable with the right type.
Fixed by resetting the variable to None when re-querying the list of
drivers and dropped the class variable in favor of the instance variable
(with the right type this time).
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
The script can be invoked in different ways:
Run mypy in the current working directory and display the output:
$ scripts/run-mypy.py
Run mypy in a clean copy of the HEAD revision:
$ scripts/run-mypy.py --checkout-head
Run mypy in the current working directory and compare the result with
another revision (here main):
$ scripts/run-mypy.py --diff-against main
Run mypy in a clean copy of the HEAD revision and compare with another
revision (here main):
$ scripts/run-mypy.py --diff-against main --checkout-head
The produced result might be slightly different from what the CI does
because it also clones checks out curtin and probert (at the right
revision). This is something we might want to do in the CI as well.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>