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.
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>