os-prober is leaving around invalid devices and we don't know what to do
about it yet, but we do know that we don't require os-prober for
20.04.4. Back this out. LP: #1961640 LP: #1961628
AptConfigurer.setup_overlays() used to accept either a single Lower
directory or a sequence of them. It oftentimes felt confusing so we now
accept only a sequence of Lower's. If we want to pass a single Lower, we
can just pass a list with a single element.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Added some unit tests for translating different "types" of directories
into a list of options suitable for mount -t overlay.
The unit tests can also be used as examples to visualize how a given
overlay would be configured depending on the parameters that are given
for its creation.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Create open_perms context manager for custom or multiple writes.
Create generate_config for a small removal of redundancy.
0640 root:adm the resulting files.
GeoIP requests used to run on the default executor thread and would
prevent the application from exiting if the GeoIP service would not
respond quickly enough. We witnessed an obvious impact during an
incident on geoip.ubuntu.com.
Move to aiohttp so that the HTTP calls are non blocking.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
We used to make real HTTP calls to geoip.ubuntu.com in dry-run mode.
This might have an impact on the service when running automatic testing.
We now provide an hardcoded value for the GeoIP information in dry-run
mode.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
The u-a-c returns a set of information about each service. After
filtering out the services that we don't want using the fields
"entitled" and "available", we now only keep the name and the
description of the service.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
The list of activable UA services was only retrieved from the
client-side of Subiquity (using ubuntu-advantage-tools). Therefore, the
desktop installer would need to reimplement the same logic should they
need access to the list of services ; which is inconvenient.
We now expose a new endpoint in the API that takes the token as
a parameter and returns a status (+ a list of services if the token is
valid and not expired).
$ curl \
--unix-socket .subiquity/socket \
--header 'Content-Type: application/json' \
http://a/ubuntu_advantage/check_token \
-d '"C123456"'
The token parameter is expected to be in the body of the request -
rather than in the query string - to avoid ending up in the access logs.
This new endpoint is a read-only GET endpoint. It is not designed as a
replacement for the POST to /a/ubuntu_advantage that the client must
(still) do to pass the token to the model.
We now use this new endpoint internally in Subiquity so that the
retrieval of the activable services is done on the server-side only.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Instead of only checking if a given UA service is available, we now also
check if it is entitled.
- the available field for a service refers to its availability on the
current machine (e.g. on Focal running on a amd64 CPU) ; whereas
- the entitled field tells us if the contract covers the service.
Therefore, we need to make sure that we only list the services that are
both "available" and "entitled".
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>