specifying apt_mirror of '' renders empty entries in /etc/apt/sources.list for uri
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Unassigned | ||
cloud-init (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
juju-core (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
Xenial |
New
|
Undecided
|
Unassigned |
Bug Description
==== Begin SRU Template ====
[Impact]
This is a bug that existed only in development time in cloud-init and was exposed during uploads to yakkety. It has never existed in xenial, but we do need to make sure that the function is still present.
The impact was that if a user (juju) started an instance with:
apt_mirror: ''
that was taken as the apt mirror and /etc/apt/
[Test Case]
$ cat /tmp/foo.ud
#cloud-config
apt_mirror: ''
$ lxc launch ubuntu-daily:xenial sm-x0 "--config=
$ sleep 10
$ lxc exec sm-x0 grep yakkety /etc/apt/
deb yakkety main restricted
deb-src yakkety main restricted
deb yakkety-updates main restricted
Expected behavior is to see http://
[Regression Potential]
Over all, the apt configuration feature could have other regressions
similar to this, but this specific change has very little chance for regresion.
==== End SRU Template ====
$ cat /tmp/foo.ud
#cloud-config
apt_mirror: ''
$ lxc launch ubuntu-
$ sleep 10
$ lxc exec sm-y0 grep ^deb /etc/apt/
deb yakkety main restricted
deb-src yakkety main restricted
deb yakkety-updates main restricted
## Now get -proposed version.
$ lxc exec sm-x0 -- sh -c '
p=/
echo deb http://
apt-get update -q && apt-get -qy install cloud-init'
## cleanup so it thinks its fresh
$ lxc exec sm-x0 -- sh -c '
cd /var/lib/cloud && for d in *; do [ "$d" = "seed" ] || rm -Rf "$d"; done
rm -Rf /var/log/
$ lxc exec sm-x0 reboot
$ lxc exec sm-x0 grep ^deb /etc/apt/
deb http://
deb-src http://
deb http://
basically if you provide an empty apt_mirror in the old format, then it is taken as providing an apt mirror. This non-true value should just be the same as not providing it.
ProblemType: Bug
DistroRelease: Ubuntu 16.10
Package: cloud-init 0.7.7-22-
ProcVersionSign
Uname: Linux 4.4.0-9136-generic x86_64
ApportVersion: 2.20.3-0ubuntu7
Architecture: amd64
Date: Wed Sep 7 17:12:11 2016
PackageArchitec
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Christian Ehrhardt : Approve
- Ryan Harper: Approve
-
Diff: 66 lines (+29/-2)2 files modifiedcloudinit/config/cc_apt_configure.py (+7/-2)
tests/unittests/test_handler/test_handler_apt_conf_v1.py (+22/-0)
affects: | juju (Ubuntu) → juju-core (Ubuntu) |
no longer affects: | curtin |
description: | updated |
description: | updated |
I made this affect juju also, as where this bug was filed juju explicitly declared:
$ sudo grep apt_mirror /var/lib/ cloud/instance/ cloud-config. txt
apt_mirror: ''