Merge ~nacc/curtin:nacc/curtin-mirror-config into curtin:master

Proposed by Nish Aravamudan
Status: Needs review
Proposed branch: ~nacc/curtin:nacc/curtin-mirror-config
Merge into: curtin:master
Diff against target: 26 lines (+9/-2)
1 file modified
curtin/commands/apt_config.py (+9/-2)
Reviewer Review Type Date Requested Status
Paride Legovini Needs Fixing
Server Team CI bot continuous-integration Needs Fixing
Review via email: mp+395582@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:b2b2f64b20e0be7f31d68e879e69cba732a3d84d

No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want jenkins to rebuild you need to trigger it yourself):
https://code.launchpad.net/~nacc/curtin/+git/curtin/+merge/395582/+edit-commit-message

https://jenkins.ubuntu.com/server/job/curtin-ci/39/
Executed test runs:
    FAILURE: https://jenkins.ubuntu.com/server/job/curtin-ci/nodes=metal-amd64/39/
    FAILURE: https://jenkins.ubuntu.com/server/job/curtin-ci/nodes=metal-arm64/39/
    FAILURE: https://jenkins.ubuntu.com/server/job/curtin-ci/nodes=metal-ppc64el/39/
    FAILURE: https://jenkins.ubuntu.com/server/job/curtin-ci/nodes=metal-s390x/39/

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/curtin-ci/39//rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Paride Legovini (paride) wrote :

CI failing for reasons all related to:

AttributeError: 'dict' object has no attribute 'fetch'

review: Needs Fixing

Unmerged commits

b2b2f64... by Nishanth Aravamudan <email address hidden> on 2020-12-23

apt_config: allow in-place source.list modification to use mirror from config

If no sources.list template is provided for an `apt` stanza,
generate_source_list will use the default_mirrors unconditionally,
even when that same stanza is defining a mirror. This seems counter-
intuitive, given that the config-specified mirror is fetched earlier
in the function. Attempt to use a config-specified value, and fallback
to the default values.

A side-effect of the current code is that without this change, when
the dist files are renamed on the target filesystem, if the in-use
mirror is not an exact match for the public Ubuntu archive, apt
gets very unhappy.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/commands/apt_config.py b/curtin/commands/apt_config.py
2index ff906be..5ed628e 100644
3--- a/curtin/commands/apt_config.py
4+++ b/curtin/commands/apt_config.py
5@@ -298,12 +298,19 @@ def generate_sources_list(cfg, release, mirrors, target=None):
6 tmpl = util.load_file(paths.target_path(target, aptsrc))
7 # Strategy if no custom template was provided:
8 # - Only replacing mirrors
9+ # + Allow overriding via config (@params)
10 # - no reason to replace "release" as it is from target anyway
11 # - The less we depend upon, the more stable this is against changes
12 # - warn if expected original content wasn't found
13- tmpl = mirror_to_placeholder(tmpl, default_mirrors['PRIMARY'],
14+ tmpl = mirror_to_placeholder(tmpl,
15+ params.fetch(
16+ 'PRIMARY',
17+ default_mirrors['PRIMARY']),
18 "$MIRROR")
19- tmpl = mirror_to_placeholder(tmpl, default_mirrors['SECURITY'],
20+ tmpl = mirror_to_placeholder(tmpl,
21+ params.fetch(
22+ 'SECURITY',
23+ default_mirrors['SECURITY']),
24 "$SECURITY")
25
26 orig = paths.target_path(target, aptsrc)

Subscribers

People subscribed via source and target branches