Views that are dynamically updated using asynchronous events that are
handled by urwid need to be redrawn.
Ensure that such events trigger a redraw.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Wieh urwid > 2.1.2, the screen is only redrawn after urwid handles an
event (e.g., keypress, resize, ...) or an urwid alarm (it is like a
timer).
All other changes made to the UI do not trigger a screen redraw. We now
redraw the screen properly after moving from one screen to another.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Subiquity snap doesn't stage language-selector-common nor locales
packages.
Attempting to run those commands require respecting the env previously
prepared by the caller, as well as fixing the commands paths
(or changing the PATH env var in the env preparation step).
Since the apt commands were already ran with a fixed path,
I'm applying the same principle in here.
Yet, for now, Jammy doesn't ship the l-s-c package seeded,
so a condition was preserved to avoid future crashes.
UDI snap ships the package, thus its data dir is part of the snap
subiquity snap does not.
This tries l-s-c data dir in the base system, outside of the snap
and gives up if the dir does not exits.
create_task has the following note:
Important: Save a reference to the result of this function, to avoid a
task disappearing mid-execution.
Convert existing usage of create_task to run_bg_task, if that
create_task is not actually storing the result.
Recent changes in GUI turned possible to have that field as None,
leading to a crash.
This avoids the crash while preserving the default behavior of
installing the language packs.
That variant would only apply configs if in autoinstall.
There are no more screens available related to those settings in
wsl_setup.
Reconfiguration variant is the only one able to write that file.
setuptools declares a certain number of entry points that use the main
function of the associated component. That said, now that main is an
async function, it does not work. There seems to be no way to tell
setuptools to wrap the call to the entry point with asyncio.run so we
need to revert to a synchronous main function.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Where we don't have a proper snapd support.
Approach similar to the one used in UDI.
For the case where we have Subiquity snap, but not UDI.
The script added is a stripped version of the UDI one.
Removed code related to:
- GTK and GDK;
- GI repository;
- Xkb;
Preserved:
- Python;
- XDG directory definitions;
- font config;
to the WSLSetupOptions controller.
Misuse of the default_loader().
That's meant for loading /etc/wsl.conf.
WSLSetupOptions is by design not related to that config file.
Intended to receive options that affect the setup process.
and won't be written to /etc/wsl.conf
Options relative to that conf file are handled by WslConfBase and
WslConfAdvanced.
Currently only the option for skip installing language packs is
available.
With the plan to call curtin multiple times where each invocation has a
specific purpose, we want the client to have a simple way to monitor the
status of the installation.
Instead of defining new application states for each stage, we will
report the more generic WAITING / RUNNING states in a loop until we get
to the final stages of the installation.
To start with, we are dropping POST_WAIT and POST_RUNNING in favor or
WAITING and RUNNING.
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>