Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

over-riding distro config still broken #2339

Closed
ubuntu-server-builder opened this issue May 9, 2023 · 9 comments
Closed

over-riding distro config still broken #2339

ubuntu-server-builder opened this issue May 9, 2023 · 9 comments
Labels
launchpad Migrated from Launchpad priority Fix soon

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #1090482

Launchpad details
affected_projects = ['cloud-init (Ubuntu)', 'cloud-init (Ubuntu Quantal)', 'cloud-init (Ubuntu Raring)']
assignee = None
assignee_name = None
date_closed = 2013-05-15T20:00:31.911081+00:00
date_created = 2012-12-14T17:36:30.169075+00:00
date_fix_committed = 2012-12-17T15:27:04.029886+00:00
date_fix_released = 2013-05-15T20:00:31.911081+00:00
id = 1090482
importance = high
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1090482
milestone = None
owner = smoser
owner_name = Scott Moser
private = False
status = fix_released
submitter = smoser
submitter_name = Scott Moser
tags = ['amd64', 'apport-bug', 'ec2-images', 'raring', 'verification-done']
duplicates = []

Launchpad user Scott Moser(smoser) wrote on 2012-12-14T17:36:30.169075+00:00

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)

@ubuntu-server-builder ubuntu-server-builder added launchpad Migrated from Launchpad priority Fix soon labels May 9, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2012-12-14T17:36:30.169075+00:00

Launchpad attachments: Dependencies.txt

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Joshua Harlow(harlowja) wrote on 2012-12-14T18:27:23.209626+00:00

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

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Joshua Harlow(harlowja) wrote on 2012-12-15T05:24:16.985831+00:00

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 :-)

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2012-12-16T16:06:36+00:00

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

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Joshua Harlow(harlowja) wrote on 2012-12-16T18:46:59.798547+00:00

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

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2012-12-17T15:27:02.943082+00:00

fixed upstream in revno 750. Thanks Josh.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2012-12-17T17:01:27.133546+00:00

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

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2013-01-09T00:58:39.730083+00:00

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

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2013-05-15T20:00:30.272549+00:00

fixed in 0.7.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
launchpad Migrated from Launchpad priority Fix soon
Projects
None yet
Development

No branches or pull requests

1 participant