Merge lp:~james-page/simplestreams/full-arch-support into lp:~smoser/simplestreams/trunk

Proposed by James Page
Status: Merged
Merged at revision: 397
Proposed branch: lp:~james-page/simplestreams/full-arch-support
Merge into: lp:~smoser/simplestreams/trunk
Diff against target: 41 lines (+19/-5)
1 file modified
simplestreams/mirrors/glance.py (+19/-5)
To merge this branch: bzr merge lp:~james-page/simplestreams/full-arch-support
Reviewer Review Type Date Requested Status
Scott Moser Pending
Review via email: mp+271095@code.launchpad.net

Description of the change

Ensure all Ubuntu architectures get correctly mapped into ones that
OpenStack and libvirt understand.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'simplestreams/mirrors/glance.py'
--- simplestreams/mirrors/glance.py 2015-07-27 15:00:23 +0000
+++ simplestreams/mirrors/glance.py 2015-09-15 10:53:48 +0000
@@ -42,6 +42,24 @@
42 'datatype': 'image-ids', 'format': 'products:1.0'}42 'datatype': 'image-ids', 'format': 'products:1.0'}
4343
4444
45def canonicalize_arch(arch):
46 '''Canonicalize Ubuntu archs for use in OpenStack'''
47 newarch = arch.lower()
48 if newarch == "amd64":
49 newarch = "x86_64"
50 if newarch == "i386":
51 newarch = "i686"
52 if newarch == "ppc64el":
53 newarch = "ppc64le"
54 if newarch == "powerpc":
55 newarch = "ppc"
56 if newarch == "armhf":
57 newarch = "armv7l"
58 if newarch == "arm64":
59 newarch = "aarch64"
60 return newarch
61
62
45# glance mirror 'image-downloads' content into glance63# glance mirror 'image-downloads' content into glance
46# if provided an object store, it will produce a 'image-ids' mirror64# if provided an object store, it will produce a 'image-ids' mirror
47class GlanceMirror(mirrors.BasicMirrorWriter):65class GlanceMirror(mirrors.BasicMirrorWriter):
@@ -177,11 +195,7 @@
177 arch = flat.get('arch')195 arch = flat.get('arch')
178 if arch:196 if arch:
179 t_item['arch'] = arch197 t_item['arch'] = arch
180 if arch == "amd64":198 props['architecture'] = canonicalize_arch(arch)
181 arch = "x86_64"
182 if arch == "i386":
183 arch = "i686"
184 props['architecture'] = arch
185199
186 fullname = self.name_prefix + name200 fullname = self.name_prefix + name
187 create_kwargs = {201 create_kwargs = {

Subscribers

People subscribed via source and target branches

to all changes: