~dgadomski/curtin:revert-curthooks-apt-config-hacks

Last commit made on 2023-03-02
Get this branch:
git clone -b revert-curthooks-apt-config-hacks https://git.launchpad.net/~dgadomski/curtin
Only Dariusz Gadomski can upload to this branch. If you are Dariusz Gadomski please log in for upload directions.

Branch merges

Branch information

Name:
revert-curthooks-apt-config-hacks
Repository:
lp:~dgadomski/curtin

Recent commits

f0556cc... by Olivier Gayot

Revert "Make sure curthooks do not discard supplied proxy settings"

This reverts commit b49f5b1505d6597a5c64e3220bb45a291d9a78f7.

9aed2e3... by Olivier Gayot

Revert "Make sure curthooks do not discard APT preferences"

This reverts commit bfbba202e2cc3b02e4e3953081effb6768da41a8.

cc23249... by Olivier Gayot

apt-config: stop returning cfg object in translate_old_apt_features

The translate_old_apt_features function mutates its parameter, but also
used to return the translated object. This goes against the rules of
idiomatic Python. Returning a new configuration object without mutating
the original one would require leaning on copy.deepcopy, which is
expensive and not always needed.

Let's stop returning the resulting configuration so the interface is
clear.

Signed-off-by: Olivier Gayot <email address hidden>

9017770... by Olivier Gayot

apt-config: fix wrong value printed in debug log

Signed-off-by: Olivier Gayot <email address hidden>

ce9ca97... by Olivier Gayot

apt-config: fix curthooks unconditionally triggering apt-config

The following commit:

  1257a38f translate old curtin apt features to new format

introduced the ability to translate old top level keys related to apt
features (e.g., debconf_selections, apt-proxy, apt-mirrors) to the new
format where they are stored as children of 'apt'.

                              apt:
debconf_selections: => debconf_selections:
  foobar foobar

Sadly, by doing so, it introduced a regression, making curthooks call
apt_config.handle_apt unconditionally.

The curthooks.do_apt_config function only calls apt_config.handle_apt if
the configuration does not contain the 'apt' key or if the 'apt' key has
the value None (i.e., null in YAML). When implementing the translation
from old to new configuration format, we accidentally forced the 'apt'
key to exist and coerced it to dictionary.

This effectively defeats the condition in curthooks.do_apt_config.

Fixed by making sure we only create the apt key if needed when doing the
translation.

Signed-off-by: Olivier Gayot <email address hidden>

5af0927... by Alexsander de Souza

add SLES support

a696088... by Dan Bungert

integration: use sfdisk as the source of info

sysfs size of extended partitions is known to provide a strange
number, and we're using a mix of sysfs and sfdisk, so primarily get
info from sfdisk and compare what we can to sysfs.

c56c51a... by Dan Bungert

block/v1: handle msdos+swap

8c5f87e... by Michael Hudson-Doyle

block_meta: all fields on a disk action must match with v2 config

This is for https://bugs.launchpad.net/subiquity/+bug/1929213 and
similar reports.

6d11406... by Dan Bungert

apt: use string.format instead of f-string

In pursuit of older python version support, drop the f-string usage.

Co-Authored-By: Olivier Gayot <email address hidden>