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>