_AsyncValidatedMixin has been merged into the parent UsernameEditor,
reluctantly. I like the concept of _AsyncValidatedMixin, but what's
happening here is that UsernameEditor has inherited from 3 classes, the
first of which is in urwid, and when the constructor /
super().__init__() status changed in urwid,
_AsyncValidatedMixin.__init__() stopped being called.
OK cool, so maybe we'll just manually run initializers in the case where
it matters. That's semi-better, but with old urwid we end up calling
_AsyncValidatedMixin.__init__() twice (once directly, once by the urwid
__init__ using super()).
Further workarounds could be employed but at the moment there is one
user of _AsyncValidatedMixin, so just merge it into UsernameEditor.
Instead of manually changing the autoinstall-schema reference,
use literalinclude to insert the autoinstall-schema.json file
from the root of the repository.
Provided autoinstall data is already validated against a specific
schema by the relevant controller, but these schemas themselves
are never validated against a meta schema to guarantee they are
valid JSON schemas. This patch adds unit tests for each controller,
as well as SubiquityServer, to validate their autoinstall schema
against the latest JSON meta schema draft (that is supported in
jsonschema). A particular draft validator can be used instead by
specifying meta schema in the schema definition.
The SSHModel contained a ssh_import_id member variable. According to the
comment, it was originally meant to store meta-data about a SSH key ;
and was supposed to allow showing some sort of info back in the SSH view
if the user decides to go back.
I suspect that this variable has been unused for a long time.
Furthermore, it can only hold information about a single SSH key and we
support multiple keys..
Let's get rid of it.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
The /etc/lsb-release file currently on noble shows:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu Noble Numbat (development branch)"
Therefore, the Ubuntu Pro pages get skipped. This makes testing on noble
difficult, so make an exception for noble now and we'll drop it once
it's marked LTS.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Instead of supporting only string components, mount.p() now supports
strings, pathlib.Path()s, or a combination of both.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Back when sources.list was always present, we would:
* move the contents of sources.list to sources.list.d/original.list
* write the CDROM info to sources.list so the CDROM cat be used as an
APT source
* restore the original sources.list file when .deconfigure() is called,
effectively discarding CDROM info
Nowadays, there is no guarantee that sources.list exists. So restoring
the contents of sources.list may mean deleting sources.list if it wasn't
present in the first place.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
When an error occurs during the execution of a "$ curtin install"
invocation, the associated bug report would be titled:
"install failed crashed with CalledProcessError"
This is not very user friendly and it does not immediately give any
insight on:
With the number of reports that we receive these days, I think
classifying these reports would make our life a bit easier, and possibly
make the users understand better what's going on.
This change adds a wat to detect if a bug report is the result of a
"$ curtin install" invocation failing. If it is, subiquity sets the
title of the bug report accordingly. Examples:
* "partitioning crashed with CurtinInstallError"
* "extract crashed with CurtinInstallError"
* "curthooks crashed with CurtinInstallError"
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
We know that running os-prober on some systems is slow, potentially very
slow, especially when multiple removable devices are present.
This results in many bug reports showing "block probing crashed with
TimeoutError".
For now, I suggest we double the probert timeout when os-prober is
involved.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
We backup the sources.list to a file in sources.list.d to be
able to insert our source first; if we do not have a sources.list
this is not necessary.
If an image uses ubuntu.sources, this logic also works fine as
sources.list that we write will be sourced before the ubuntu.sources.
Modify wrapper to consider consol-conf installed as snap.
Prepare sshd finger prints to be used by consol-conf snap.
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
We write out the autoinstall data to make the install repeatable
but this should also include a reference to the autoinstall
documentation to increase usability.
In Python < 3.11, when passing a coroutine to asyncio.wait, it would
automatically be scheduled as a task. This isn't the case anymore with
Python 3.11. Now passing coroutines to asyncio.wait fails with:
TypeError: Passing coroutines is forbidden, use tasks explicitly.
Let's ensure we schedule the coroutines as tasks before passing them on
to asyncio.wait.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>