over-riding distro config still broken

Bug #1090482 reported by Scott Moser
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
High
Unassigned
cloud-init (Ubuntu)
Fix Released
High
Scott Moser
Quantal
Fix Released
High
Scott Moser
Raring
Fix Released
High
Scott Moser

Bug Description

bug reported in bug 1076811 is still affecting trunk.

See this example:

$ ec2metadata --user-data
#cloud-config
system_info:
   # This will affect which distro class gets used
   distro: ubuntu
   # Other config here will be given to the distro class and/or path classes
   package_mirrors:
     - arches: [i386, amd64]
       failsafe:
         primary: http://archive.ubuntu.com/ubuntu
         security: http://security.ubuntu.com/ubuntu
       search:
         primary:
           - http://bogus.invalid.com/ubuntu/
         security: []
     - arches: [armhf, armel, default]
       failsafe:
         primary: http://ports.ubuntu.com/ubuntu-ports
         security: http://ports.ubuntu.com/ubuntu-ports

That resulted in:
$ grep -v "^#" /etc/apt/sources.list | grep . | head -n 4
deb http://nova.clouds.archive.ubuntu.com/ubuntu/ raring main
deb-src http://nova.clouds.archive.ubuntu.com/ubuntu/ raring main
deb http://nova.clouds.archive.ubuntu.com/ubuntu/ raring-updates main
deb-src http://nova.clouds.archive.ubuntu.com/ubuntu/ raring-updates main

debugging with, I added these lines to /usr/share/pyshared/cloudinit/config/cc_apt_configure.py right
before the call to cloud.datasource.get_package_mirror_info() in find_apt_mirror_info.
    print "cloud.distro: %s" % cloud.distro
    print " package_mirrors: %s" % cloud.distro.get_option("package_mirrors", [])
    print "cloud.datasource.distro: %s" % cloud.datasource.distro
    print " package_mirrors: %s" % cloud.datasource.distro.get_option("package_mirrors", [])

The issue is that the 'datasource's distro != the 'cloud's distro.

$ sudo _CLOUD_INIT_SAVE_STDOUT=1 cloud-init single --name=apt-configure --frequency=always
Cloud-init v. 0.7.1 running 'single' at Fri, 14 Dec 2012 17:35:40 +0000. Up 4808.29 seconds.
cloud.distro: <cloudinit.distros.ubuntu.Distro object at 0x166f350>
  package_mirrors: [{'arches': ['i386', 'amd64'], 'failsafe': {'security': 'http://security.ubuntu.com/ubuntu', 'primary': 'http://archive.ubuntu.com/ubuntu'}, 'search': {'security': [], 'primary': ['http://bogus.invalid.com/ubuntu/']}}, {'arches': ['armhf', 'armel', 'default'], 'failsafe': {'security': 'http://ports.ubuntu.com/ubuntu-ports', 'primary': 'http://ports.ubuntu.com/ubuntu-ports'}}]
cloud.datasource.distro: <cloudinit.distros.ubuntu.Distro object at 0x1ddff90>
  package_mirrors: [{'arches': ['i386', 'amd64'], 'failsafe': {'security': 'http://security.ubuntu.com/ubuntu', 'primary': 'http://archive.ubuntu.com/ubuntu'}, 'search': {'security': [], 'primary': ['http://%(ec2_region)s.ec2.archive.ubuntu.com/ubuntu/', 'http://%(availability_zone)s.clouds.archive.ubuntu.com/ubuntu/']}}, {'arches': ['armhf', 'armel', 'default'], 'failsafe': {'security': 'http://ports.ubuntu.com/ubuntu-ports', 'primary': 'http://ports.ubuntu.com/ubuntu-ports'}}]

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: cloud-init 0.7.1-0ubuntu3 [modified: usr/share/pyshared/cloudinit/config/cc_apt_configure.py usr/share/pyshared/cloudinit/distros/__init__.py]
ProcVersionSignature: User Name 3.7.0-5.13-generic 3.7.0-rc8
Uname: Linux 3.7.0-5-generic x86_64
ApportVersion: 2.6.3-0ubuntu4
Architecture: amd64
Date: Fri Dec 14 17:30:01 2012
Ec2AMI: ami-0000018a
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.tiny
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
MarkForUpload: True
PackageArchitecture: all
ProcEnviron:
 TERM=screen
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Scott Moser (smoser) wrote :
Changed in cloud-init:
status: New → Confirmed
Changed in cloud-init (Ubuntu):
status: New → Confirmed
Changed in cloud-init:
importance: Undecided → High
Changed in cloud-init (Ubuntu):
importance: Undecided → High
Revision history for this message
Joshua Harlow (harlowja) wrote :

Thats really odd. Will try to look into how its not getting reset still.

Revision history for this message
Joshua Harlow (harlowja) wrote :

Is it just me or did the merge not go through correctly?

See: https://bazaar.launchpad.net/~harlowja/cloud-init/ds-reset-fix/revision/741

Looking at the current "head" function for distro() that was supposed to be different, it doesn't appear to have reflected that merge??

https://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/cloudinit/stages.py#L75

Possibly thats why :-)

Revision history for this message
Scott Moser (smoser) wrote : Re: [Bug 1090482] Re: over-ridding distro config still broken

On Sat, 15 Dec 2012, Joshua Harlow wrote:

> Is it just me or did the merge not go through correctly?
>
> See: https://bazaar.launchpad.net/~harlowja/cloud-init/ds-reset-
> fix/revision/741
>
> Looking at the current "head" function for distro() that was supposed to
> be different, it doesn't appear to have reflected that merge??
>
> https://bazaar.launchpad.net/~cloud-init-dev/cloud-
> init/trunk/view/head:/cloudinit/stages.py#L75
>
> Possibly thats why :-)

It looks like yo'ure right.
Look at my comment in '#' there (the first one).
I thought that the issue was not actually real, so I only pulled one piece
of the merge.

Thanks for pointing this out.
Scott

Revision history for this message
Joshua Harlow (harlowja) wrote : Re: over-ridding distro config still broken

Sure, I can submit a new merge/review if u want. Simple stuff to add back in. Shall I?

Scott Moser (smoser)
summary: - over-ridding distro config still broken
+ over-riding distro config still broken
Revision history for this message
Scott Moser (smoser) wrote :

fixed upstream in revno 750. Thanks Josh.

Changed in cloud-init:
status: Confirmed → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote :

fix-released in 0.7.1-0ubuntu4.
but the commit message incorrectly referenced (LP: #090482).

Changed in cloud-init (Ubuntu Quantal):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Scott Moser (smoser)
Changed in cloud-init (Ubuntu Raring):
assignee: nobody → Scott Moser (smoser)
Changed in cloud-init:
milestone: none → 0.7.2
Scott Moser (smoser)
Changed in cloud-init (Ubuntu Raring):
status: Confirmed → Fix Released
Revision history for this message
Scott Moser (smoser) wrote :

fixed in -quantal proposed update 0.7.0-0ubuntu2.2

Changed in cloud-init (Ubuntu Quantal):
status: In Progress → Fix Committed
Scott Moser (smoser)
tags: added: verification-done
Scott Moser (smoser)
Changed in cloud-init (Ubuntu Quantal):
status: Fix Committed → Fix Released
Revision history for this message
Scott Moser (smoser) wrote :

fixed in 0.7.2

Changed in cloud-init:
milestone: 0.7.2 → none
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
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.