Similarly to field names, the snapd API returns objects with values that
should be part of an enumeration, but with values that are not all
Python identifiers (e.g. "system-seed"). To allow these to be mapped to
enum's in Python that are not insanely annoying to use, allow a
Serializer to serialize enum's to and from their values rather than
their names (which remains the default behaviour).
Many snapd APIs return JSON objects with field names that are not valid
Python identifiers (such as "display-name") so if we're going to
translate them to and from Python objects we need to be able to override
the field name in the serialized form.
Some snapd APIs return JSON objects with lots and lots of fields and I
don't want to have to declare the ones I am not interested in. Also, I
think snapd adds fields over time, so I don't want to be broken when
this happens.
to the WSLSetupOptions controller.
Misuse of the default_loader().
That's meant for loading /etc/wsl.conf.
WSLSetupOptions is by design not related to that config file.
When editing a LVM logical volume (LV), Subiquity would crash with the
following error:
filesystem/gaps.py", line 244, in movable_trailing_partitions_and_gap_size
pgs = parts_and_gaps(partition.device)
AttributeError: 'LVM_LogicalVolume' object has no attribute 'device'
When we changed the implementation to use
movable_trailing_partitions_and_gap_size, we did not pay attention to
the LVM use case.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
The mirror controller is responsible from creating the APT configuration
once its associated model is marked configured. However, the APT
configuration is also dependent on the source model being marked
configured.
When subiquity is used for the server installer, the client immediately
sends a POST /a/meta/client_variant request. This ends up marking the
source model as configured (even though the default value does not make
much sense). So we never end up in a scenario where the mirror model is
marked configured before the source model.
When Subiquity is used by a different client, such as the
ubuntu-desktop-installer, it is possible that we mark the mirror model
configured first. This ends up crashing the installer.
Fixed by adding a dependency on the source model so that we do not end
up creating the APT configuration too early.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
When creating the UI for snaplist, if the server returns a FAILED status
when we request the list of snaps, we want to move on to the next
screen.
However, calling self.next_screen in the make_ui function while also
returning an actual view triggers a race condition. Depending on the
order of execution of the instructions (which are asynchronous), the
snaplist view can end up being shown even though we moved to the next
screen. This ends up doing funny things upon clicking done.
Fixed by raising the Skip exception after making sure we mark snaplist
configured.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
When pressing the "Try again" button on the snaps list, Subiquity would
crash with:
TypeError: SnapListView.wait_load() takes 1 positional argument but 2
were given
This happens because urwid passes the sender to the callback - which we
need to discard or accept it in the signature.
Fixed by discarding the sender.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
During the installation, in the curthooks stage, curtin generates the
initramfs. Unfortunately, the generated initramfs did not honor the
keyboard mapping selected by the user during installation. Therefore,
when LUKS encryption is used for the root file-system, the prompt for
the passphrase ignores the keyboard layout set by the user.
To ensure that the initramfs uses the right keyboard layout, the
/etc/console-setup/cached_* files must be updated before the initramfs
gets created. At the beginning of the curthooks stage, we now call
setupcon --save-only in the target to refresh those files if needed.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Raise SchemaValidationError when any autoinstall.user-data config
is invalid cloud-init cloud-config schema.
If any deprecated config keys or values are provided under
autoinstall.user-data, log warnings about those deprecations.
Raise SchemaValidationErrors when invalid config is provided to
cloud-init as merged cloud-config for the installed target.
Log warnings if any deprecated cloud-config keys are present in
merged cloud-config.