We used to only accept lists of strings for commands. We now accept
sequences of strings instead ; which are lists of strings or tuple of
strings.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Having a variable named arun_command in tests interferes with tags
generated with ctags: the default tag does not point to the actual
function definition; but to the variable in test_ubuntu_advantage.py.
Excluding the tests when generating the tags would be an option but for
now we'll just rename the variable.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
After calling .communicate() on an asyncio.subprocess.Process object,
the attribute returncode gets set to a non-None value. Type checkers are
not able to figure this out.
Fixed by adding an assert to help type checkers out.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Early commands is currently documented as follows:
> The autoinstall config is available at /autoinstall.yaml
> (irrespective of how it was provided) and the file will be re-read
> after the early-commands have run to allow them to alter the config
> if necessary.
The previous change to let cloud take precedence over iso location broke
this functionality. Fix that by copying to the iso location the file of
choice.
Per LP: #1968160, with 2 or more disks, go to guided storage config, hit
done. At file system summary, hit back, and choose the other disk.
While this screen does say so, one might not notice that the first disk
is still setup to be formatted.
Instead, when going back to guided storage, a reset is also done.
We won't ship systemd officially in 22.04, hence remove it from the UI.
However it's still there and distributed and can be enabled manually.
Co-authored-by: Didier Roche <didrocks@ubuntu.com>
update requires root access to the machine and there is no --simulate
option so skip it in dry-run mode.
Co-authored-by: Didier Roche <didrocks@ubuntu.com>
UDI sets the SNAP env var to '.' for development purposes.
See: https://github.com/canonical/ubuntu-desktop-installer/commit/9eb6f04
It is unlikely that under test or production that env var will
ever by just '.'. On the other hand in dry-run we want this controller
to interpret it as '/' if not properly set, thus discarding the '.'.
When refreshing the filesystem GUI, we used to set the status (i.e.,
enabled or disabled) of the "Create LVM volume group" and "Create
software RAID" buttons multiple times ; once for each disk found.
When multiple disks are listed, this creates intermediate status changes
that are not wanted, e.g.:
* "Create software RAID" button gets set to disabled after finding a first
unpartitioned disk ;
* "Create software RAID" button is set again to disabled after finding
a partitioned disk (with no unmounted partitions) ;
* "Create software RAID" button is set to enabled after finding a
second unpartitioned disk.
Fixed by evaluating the status of the buttons only once after looping
through all disks.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
This one does change behaviour in that if it has to resize a partition
to make room for the ESP it puts it before the partition, not after.
This lets us put an assertion back in an API test.
No behaviour change yet, this all assumes version 1 partitioning, i.e.
no mix of new and old partitions on a device. But it means we only have
to edit one batch of logic when that stops being true.
A useful concept in other areas of partition / gap handling has to
require a keyword for specifying if we're sending gap or a partition.
Implement that here for the partition and gap keywords, and also on the
downstream partition_disk_handler.