When running make lint with flake8 >= 4.0.0 (available in jammy), the
following error is reported:
subiquity/server/controllers/filesystem.py:158:33:
F541 f-string is missing placeholders
Github runs the lint job in a focal container, where only version 3.8.4
of flake8 is installed. F541 is not implemented in 3.8.4 so it does not
fail.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
In case of error, u-a-c exits with status 1. When the contract token
supplied is invalid, it is also considered an error ; which previously
made us unable to make the distinction between:
* an invalid token
* a more generic error such as network error or service unavailable error
Thanks to an update in u-a-c, we can now determine if the token was
invalid, by parsing the standard output of the process, even when it
exits with status 1.
The output is expected to be a JSON object that includes an array of
errors where each error has a specific error code.
The error code for an invalid token is attach-invalid-token ; which we
now look for in the output to determine if the contract token was
invalid.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
run_answers now interacts with the GUI for the Ubuntu Pro screens.
When a contract token is provided, it is expected to be valid,
otherwise, the UI will block on Expired token or Invalid token.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
We now split the Ubuntu Pro screen into two sub views.
The first view asks whether the user wants to skip or upgrade (we call
this the upgrade_yes_no_screen in the code).
The second one asks the user to input the contract token. Going forward,
this view will also be used for Ubuntu One.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Instead of relying on the contract token empty to skip Ubuntu Pro, we
now explicitly ask the user to decide if he wants to input a token or
not. This makes a small difference in that the user is now able to
supply an empty contract token. Our different implementations (i.e.,
mock & based on u-a-c) don't handle empty tokens properly, so we now
reject empty tokens.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
We now include in the docstring a visual representation of the
"ContinueAnyway" and "UA Services" overlays.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Add calculations for a suggested minimum install size that contains
padding for swap, updates, boot.
Add calculations for helping resize, to examine the space available and
make suggestions about what the existing partition might be resized to.
The response to /ubuntu_pro/check_token now includes information about
the subscription: the name of the contract and the "name" of the account.
Instead of returning the list of services as an optional field, we now
include the list of services in the subscription object. The
subscription object is itself marked optional. This is a backward
incompatible change.
{
"status": "VALID_TOKEN",
"services": [
{
"name": "esm-infra",
"description": "UA Infra: Extended Security Maintenance (ESM)",
"auto_enabled": true
}
]
}
=>
{
"status": "VALID_TOKEN",
"subscription": {
"account_name": "user@domain.com",
"contract_name": "UA Apps - Essential (Virtual)",
"services": [
{
"name": "esm-infra",
"description": "UA Infra: Extended Security Maintenance (ESM)",
"auto_enabled": true
}
]
}
}
If the token is not valid, the subscription object will be null:
{
"status": "EXPIRED_TOKEN",
"subscription": null
}
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Because the storage views lean on the implementation of
setup_password_validation from the identity screen, we were forced to
use a form with fields named "password" and "password_confirm".
This makes the code confusing because we use the "passphrase"
terminology in the storage forms.
We now leave up to the caller to specify which fields he wants to be
part of the validation ; instead of making him provide the full form.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>