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
1=== modified file 'simplestreams/mirrors/glance.py'
2--- simplestreams/mirrors/glance.py 2015-07-27 15:00:23 +0000
3+++ simplestreams/mirrors/glance.py 2015-09-15 10:53:48 +0000
4@@ -42,6 +42,24 @@
5 'datatype': 'image-ids', 'format': 'products:1.0'}
6
7
8+def canonicalize_arch(arch):
9+ '''Canonicalize Ubuntu archs for use in OpenStack'''
10+ newarch = arch.lower()
11+ if newarch == "amd64":
12+ newarch = "x86_64"
13+ if newarch == "i386":
14+ newarch = "i686"
15+ if newarch == "ppc64el":
16+ newarch = "ppc64le"
17+ if newarch == "powerpc":
18+ newarch = "ppc"
19+ if newarch == "armhf":
20+ newarch = "armv7l"
21+ if newarch == "arm64":
22+ newarch = "aarch64"
23+ return newarch
24+
25+
26 # glance mirror 'image-downloads' content into glance
27 # if provided an object store, it will produce a 'image-ids' mirror
28 class GlanceMirror(mirrors.BasicMirrorWriter):
29@@ -177,11 +195,7 @@
30 arch = flat.get('arch')
31 if arch:
32 t_item['arch'] = arch
33- if arch == "amd64":
34- arch = "x86_64"
35- if arch == "i386":
36- arch = "i686"
37- props['architecture'] = arch
38+ props['architecture'] = canonicalize_arch(arch)
39
40 fullname = self.name_prefix + name
41 create_kwargs = {

Subscribers

People subscribed via source and target branches

to all changes: