The BIOS boot plan check assumes that there is at least one result in
the list from gaps.parts_and_gaps(), but that isn't the case if the disk
is small.
Showed up in VM testing using cloud-localds to seed the autoinstall
file.
During the development cycle of 22.04, jammy was not yet marked an LTS
version. To have Ubuntu Pro screen fire up on that version, we had to
explicitly make an exception for Jammy.
Since Jammy is official LTS now, we can drop this explicit check.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Accept a new 'mode' parameter when using autoinstall guided storage.
The default mode is 'reformat_disk', which acts as today.
A new mode of 'use_gap' is available, which does not reformat the disk.
Update the guided_methods, particularly guided_direct. It now does a
direct call to create_partition, bypassing the increasingly complicated
partition_disk_handler, making it more similar to guided_lvm, and making
way for guided partitioning into a gap.
timeout 60 might be too short for someone with lots of network
interfaces.
Since we grab the PID and run the server in the background, the timeout
is not critically necessary.
Align with latest cloud-init schema avoid using depracated
value types for users. groups definitions in cloud-config.
Also fix get_users_and_groups to return a list instead of
dict as all call sites expected it to return a list.
show_* functions from the UbuntuProView object always assumed that the
loading overlay was present. When called, they would therefore attempt
to close the overlay. This results in a crash if no overlay is present.
With the current design, it is fine because we never call the show_*
functions without an overlay being present.
However, with new design of Ubuntu Pro, sometimes the show_* functions
will be called without an overlay.
We now delegate the responsibility of removing the overlay by using a
callback system.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
The JSON returned by uaclient for a status request contains the
auto_enabled property for each service. This property tells whether a
given service is enabled automatically when `ua attach` is done. We will
need this information going forward so we now include it in the success
response to /ubuntu_pro/check_token:
{
"status": "VALID_TOKEN",
"services": [
{
"name": "esm-infra",
"description": "UA Infra: Extended Security Maintenance (ESM)",
"auto_enabled": true
},
{
"name": "fips",
"description": "NIST-certified core packages",
"auto_enabled": false
}
]
}
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Instead of using isinstance(self.widget, SubFormWidget) in
BoundFormField.is_in_error, we now implement a BoundSubFormField
class that inherits from BoundFormField. It is meant to be instantianted
for subforms fields only.
This class overrides is_in_error() to perform the additional checks in
the forms' sub-fields.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
When the validation of a field fails in a form, we disable the Done
button. With child forms, however, it did not work because they have
their own set of hidden buttons ; that are not the ones the users
interacts with.
This patch makes parent forms recurse on the child forms when checking
if any field is in error. Also, when a child form undertakes validation,
it now propagates to the parent, so that the done button can be
immediately enabled/disabled.
Having a validation error in a child form that is not currently enabled
should not prevent the user from moving forward, so we disable recursion
for child forms that are disabled.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>