curthooks running apt-config unconditionnally

Bug #2008688 reported by Olivier Gayot
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subiquity
Fix Released
Undecided
Olivier Gayot
curtin (Ubuntu)
Fix Committed
Undecided
Olivier Gayot

Bug Description

The conditional execution of apt_config.handle_apt from curthooks builtins has been broken for a while. This results in parts of the apt configuration (e.g., proxy settings, apt preferences...) being discarded mid install when using Subiquity.

A regression was introduced in 2016 when adding a mechanism to translate things like:

```
                                  apt:
    debconf_selections: => debconf_selections:
      foobar foobar
```

The function responsible for calling handle_apt is as follows:

def do_apt_config(cfg, target):
    cfg = apt_config.translate_old_apt_features(cfg)
    apt_cfg = cfg.get("apt")
    if apt_cfg is not None:
        LOG.info("curthooks handling apt to target %s with config %s",
                 target, apt_cfg)
        apt_config.handle_apt(apt_cfg, target)
    else:
        LOG.info("No apt config provided, skipping")

Sadly, the implementation of translate_old_apt_features made is so that the `if apt_cfg is not None:` condition is always true.

This bug is the root cause:
https://bugs.launchpad.net/subiquity/+bug/1970409
https://code.launchpad.net/~ogayot/curtin/+git/curtin/+merge/414408

I suggest we revert the changes after merging the relevant fixes

Tags: fr-3533

Related branches

Olivier Gayot (ogayot)
Changed in curtin (Ubuntu):
assignee: nobody → Olivier Gayot (ogayot)
status: New → In Progress
Changed in subiquity:
assignee: nobody → Olivier Gayot (ogayot)
status: New → In Progress
Olivier Gayot (ogayot)
description: updated
tags: added: fr-3533
summary: - curthooks runnng apt-config unconditionnally
+ curthooks running apt-config unconditionnally
Olivier Gayot (ogayot)
Changed in subiquity:
status: In Progress → Fix Committed
Changed in curtin (Ubuntu):
status: In Progress → Fix Committed
Olivier Gayot (ogayot)
Changed in subiquity:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.