SUBIQUITY_REPLAY_TIMESCALE should be passed to replay-curtin-log.py,
which speeds up test_server_flow (11s -> 2s), and probably others.
For the unit test, by clearing the environment and using a known set,
we can avoid having to keep a second copy of the allow list in test.
It seemed far too much complicated find the proper way to deal with
apt Python library under the snap environment.
Opted for running the system apt command without the LD_*
customisations, similar to what an installer does when chroot into the
taget system.
This allows for running subprocess outside of the snap environment.
Both functions now receive a custom env without the LD_ related vars.
Renamed _create_user() to create_user() to make explicit that it has the
same semantic level as apply_locale().
The trap on ERR doesn't trigger in all the cases that we want.
The EXIT trap seems to be more robust, albeit with the requirement to
actually check the result code.
Move from using .subiquity as output-base to a tmpdir. This solves
several practical problems, like accidentally running the tests while
dryrun is open in another terminal or any other case where the server
process that is connected to is not the one that is expected.
Also makes cleanup nicer.
On failure, it will show which temporary directory was used to allow for
easy log examination.
To allow customization where an install iso can have the autoinstall
data, and to ignore that in favor of autoinstall from cloud-config, this
implements a more specific order of loading from the possible locaitons.
Also, the chosen file is set aside, and then is top priority if the
subiquity process is reloaded.
Grow a new API for enabling/disabling systemd experimental support. We
do this by chaining a specific command= in the boot section.
We preserve the user customized command= content when systemd
experimental support is not enabled.
Co-authored-by: Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
In addition to autoinstall_key, controllers can now define an
autoinstall_key_alias.
The purpose of this attribute is to provide a backward compatibility
mechanism when we need to change the name of an autoinstall_key for
whatever reason.
When loading autoinstall data, if we can't find data matching the
autoinstall_key, we will now also look for data matching the key alias.
In the JSON schema, the old name (i.e., autoinstall_key_alias) will be
marked deprecated and the description will have the name of the
replacement key (i.e., autoinstall_key).
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
If you run dryrun for console-conf, go to the network page, go to an
interface, then info, a crash of the form
TypeError: object str can't be used in 'await' expression
can be seen. The signature for the core version of get_info_for_netdev
is not async, but a non-async method returning str.
So mark the core version of the function async.
Co-authored-by: Michael Hudson-Doyle <michael.hudson@canonical.com>