Verified with:

lxc launch ubuntu-daily:xenial sm-x0 "--config=user.user-data=$(cat 
/tmp/foo.ud)"
## get proposed version
lxc exec sm-x0 -- sh -c '
    p=/etc/apt/sources.list.d/proposed.list
    echo deb http://archive.ubuntu.com/ubuntu xenial-proposed main > "$p" &&
    apt-get update -q && apt-get -qy install cloud-init'

## cleanup
lxc exec sm-x0 -- sh -c '
    cd /var/lib/cloud && for d in *; do [ "$d" = "seed" ] || rm -Rf "$d"; done
    rm -Rf /var/log/cloud-init*'

lxc exec sm-x0 reboot
$ lxc exec sm-x0 grep ^deb /etc/apt/sources.list | head -n 3
deb http://archive.ubuntu.com/ubuntu xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted



** Description changed:

  ==== Begin SRU Template ====
- [Impact] 
+ [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: ''
+   apt_mirror: ''
  
  that was taken as the apt mirror and /etc/apt/sources.list would have
  empty entries where a mirror should be.
  
  [Test Case]
  $ cat /tmp/foo.ud
  #cloud-config
  apt_mirror: ''
  
  $ lxc launch ubuntu-daily:xenial sm-x0 "--config=user.user-data=$(cat
  /tmp/foo.ud)"
  
  $ sleep 10
  
  $ lxc exec sm-x0 grep yakkety /etc/apt/sources.list | head -n 3
  deb yakkety main restricted
  deb-src yakkety main restricted
  deb yakkety-updates main restricted
  
  Expected behavior is to see http://archive.ubuntu.com/ubuntu.
  
- [Regression Potential] 
+ [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-daily:yakkety sm-y0 "--config=user.user-data=$(cat
  /tmp/foo.ud)"
  
  $ sleep 10
  
- $ lxc exec sm-y0 grep yakkety /etc/apt/sources.list | head -n 3
+ $ lxc exec sm-y0 grep ^deb /etc/apt/sources.list | head -n 3
  deb  yakkety main restricted
  deb-src  yakkety main restricted
  deb  yakkety-updates main restricted
  
  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-g763f403-0ubuntu1
  ProcVersionSignature: Ubuntu 4.4.0-9136.55-generic 4.4.16
  Uname: Linux 4.4.0-9136-generic x86_64
  ApportVersion: 2.20.3-0ubuntu7
  Architecture: amd64
  Date: Wed Sep  7 17:12:11 2016
  PackageArchitecture: all
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
  SourcePackage: cloud-init
  UpgradeStatus: No upgrade log present (probably fresh install)

** Tags removed: verification-needed
** Tags added: verification-done

** Description changed:

  ==== 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/sources.list would have
  empty entries where a mirror should be.
  
  [Test Case]
  $ cat /tmp/foo.ud
  #cloud-config
  apt_mirror: ''
  
  $ lxc launch ubuntu-daily:xenial sm-x0 "--config=user.user-data=$(cat
  /tmp/foo.ud)"
  
  $ sleep 10
  
  $ lxc exec sm-x0 grep yakkety /etc/apt/sources.list | head -n 3
  deb yakkety main restricted
  deb-src yakkety main restricted
  deb yakkety-updates main restricted
  
  Expected behavior is to see http://archive.ubuntu.com/ubuntu.
  
  [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-daily:yakkety sm-y0 "--config=user.user-data=$(cat
  /tmp/foo.ud)"
  
  $ sleep 10
  
  $ lxc exec sm-y0 grep ^deb /etc/apt/sources.list | head -n 3
  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=/etc/apt/sources.list.d/proposed.list
+     echo deb http://archive.ubuntu.com/ubuntu xenial-proposed main > "$p" &&
+     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/cloud-init*'
+ 
+ $ lxc exec sm-x0 reboot
+ $ lxc exec sm-x0 grep ^deb /etc/apt/sources.list | head -n 3
+ deb http://archive.ubuntu.com/ubuntu xenial main restricted
+ deb-src http://archive.ubuntu.com/ubuntu xenial main restricted
+ deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted
+ 
  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-g763f403-0ubuntu1
  ProcVersionSignature: Ubuntu 4.4.0-9136.55-generic 4.4.16
  Uname: Linux 4.4.0-9136-generic x86_64
  ApportVersion: 2.20.3-0ubuntu7
  Architecture: amd64
  Date: Wed Sep  7 17:12:11 2016
  PackageArchitecture: all
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
  SourcePackage: cloud-init
  UpgradeStatus: No upgrade log present (probably fresh install)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1621180

Title:
  specifying apt_mirror of '' renders empty entries in
  /etc/apt/sources.list for uri

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1621180/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to