Merge ~dbungert/curtin:jammy-proxy into curtin:ubuntu/jammy

Proposed by Dan Bungert
Status: Merged
Merge reported by: Dan Bungert
Merged at revision: 15ecdeab1e3a41069e84ddcac42d8bd1747e0382
Proposed branch: ~dbungert/curtin:jammy-proxy
Merge into: curtin:ubuntu/jammy
Diff against target: 30 lines (+9/-3)
1 file modified
curtin/commands/apt_config.py (+9/-3)
Reviewer Review Type Date Requested Status
Olivier Gayot Approve
Server Team CI bot continuous-integration Pending
Review via email: mp+421598@code.launchpad.net

Commit message

Merge fix for Proxy

Cherry-pick b49f5b1505d6597a5c64e3220bb45a291d9a78f7

To post a comment you must log in.
Revision history for this message
Olivier Gayot (ogayot) :
review: Approve

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 1dc0233..4f62a86 100644
3--- a/curtin/commands/apt_config.py
4+++ b/curtin/commands/apt_config.py
5@@ -579,7 +579,7 @@ def find_apt_mirror_info(cfg, arch=None):
6
7 def apply_apt_proxy_config(cfg, proxy_fname, config_fname):
8 """apply_apt_proxy_config
9- Applies any apt*proxy config from if specified
10+ Applies any apt*proxy from config if specified
11 """
12 # Set up any apt proxy
13 cfgs = (('proxy', 'Acquire::http::Proxy "%s";'),
14@@ -592,8 +592,14 @@ def apply_apt_proxy_config(cfg, proxy_fname, config_fname):
15 LOG.debug("write apt proxy info to %s", proxy_fname)
16 util.write_file(proxy_fname, '\n'.join(proxies) + '\n')
17 elif os.path.isfile(proxy_fname):
18- util.del_file(proxy_fname)
19- LOG.debug("no apt proxy configured, removed %s", proxy_fname)
20+ # When $ curtin apt-config is called with no proxy set, it makes
21+ # sense to remove the proxy file (if present). Having said that,
22+ # this code is also called automatically at the curthooks stage with an
23+ # empty configuration. Since the installation of external packages and
24+ # execution of unattended-upgrades (which happen after executing the
25+ # curthooks) need to use the proxy if specified, we must not let the
26+ # curthooks remove the proxy file.
27+ pass
28
29 if cfg.get('conf', None):
30 LOG.debug("write apt config info to %s", config_fname)

Subscribers

People subscribed via source and target branches