Merge ~ogayot/curtin:curthooks-fix-apt-config-translation into curtin:master
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Olivier Gayot | ||||
Approved revision: | cc23249707a2773ecb1f10b17de35fff4620de9a | ||||
Merged at revision: | cc23249707a2773ecb1f10b17de35fff4620de9a | ||||
Proposed branch: | ~ogayot/curtin:curthooks-fix-apt-config-translation | ||||
Merge into: | curtin:master | ||||
Diff against target: |
173 lines (+86/-9) 4 files modified
curtin/commands/apt_config.py (+8/-8) curtin/commands/curthooks.py (+1/-1) tests/unittests/test_apt_source.py (+44/-0) tests/unittests/test_curthooks.py (+33/-0) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Hudson-Doyle | Approve | ||
Dan Bungert | Approve | ||
Server Team CI bot | continuous-integration | Approve | |
Review via email: mp+437494@code.launchpad.net |
Commit message
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'.
```
debconf_selections: => debconf_selections:
foobar foobar
```
Sadly, by doing so, it introduced a regression, making curthooks call
apt_config.
The curthooks.
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.
Fixed by making sure we only create the apt key if needed when doing the
translation.
Description of the change
The conditional execution of apt_config.
```
debconf_
foobar foobar
```
The function responsible for calling handle_apt is as follows:
def do_apt_config(cfg, target):
cfg = apt_config.
apt_cfg = cfg.get("apt")
if apt_cfg is not None:
else:
Sadly, the implementation of translate_
This first patch fixes the issue by making sure the translate_
The second patch also fixes an obvious mistake in a debug log.
PASSED: Continuous integration, rev:f83b46ec951 394599c75ab4952 166af0ff707599 /jenkins. canonical. com/server- team/job/ curtin- ci/82/ /jenkins. canonical. com/server- team/job/ curtin- ci/nodes= metal-amd64/ 82/ /jenkins. canonical. com/server- team/job/ curtin- ci/nodes= metal-arm64/ 82/ /jenkins. canonical. com/server- team/job/ curtin- ci/nodes= metal-ppc64el/ 82/ /jenkins. canonical. com/server- team/job/ curtin- ci/nodes= metal-s390x/ 82/
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/server- team/job/ curtin- ci/82// rebuild
https:/