Merge lp:~ltrager/maas-images/centos_version into lp:maas-images

Proposed by Lee Trager
Status: Merged
Merged at revision: 411
Proposed branch: lp:~ltrager/maas-images/centos_version
Merge into: lp:maas-images
Prerequisite: lp:~ltrager/maas-images/image_index
Diff against target: 71 lines (+28/-7)
2 files modified
conf/centos.yaml (+12/-0)
meph2/commands/mimport.py (+16/-7)
To merge this branch: bzr merge lp:~ltrager/maas-images/centos_version
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+355207@code.launchpad.net

Commit message

Support building a specific revision of CentOS with a specific release.

revision and release may now be defined in centos.yaml. When revision is
defined only upstream builds with a matching revision will be built. A
release may also be specified to allow revisions to be rebuilt.

To post a comment you must log in.
407. By Lee Trager

Fix tox

Revision history for this message
Blake Rouse (blake-rouse) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'conf/centos.yaml'
2--- conf/centos.yaml 2018-09-18 13:44:35 +0000
3+++ conf/centos.yaml 2018-09-18 13:44:35 +0000
4@@ -11,6 +11,12 @@
5 path_version: 7
6 release_title: "CentOS 7.0"
7 curtin_files: "{curtin_path}/centos7"
8+ # The upstream revision to create MAAS images for. All other versions
9+ # are ignored if this is defined.
10+ revision: 1808
11+ # The lp:maas-images release. This defaults to 01. Changing this will
12+ # cause a new build of the revision to be imported.
13+ release: 02
14 packages:
15 # cloud-init depends on packages from EPEL
16 - epel-release
17@@ -46,6 +52,12 @@
18 version: 6.6
19 release_title: "CentOS 6.6"
20 curtin_files: "{curtin_path}/centos6"
21+ # The upstream revision to create MAAS images for. All other versions
22+ # are ignored if this is defined.
23+ revision: 1808
24+ # The lp:maas-images release. This defaults to 01. Changing this will
25+ # cause a new build of the revision to be imported.
26+ release: 02
27 packages:
28 # cloud-init depends on packages from EPEL
29 - epel-release
30
31=== modified file 'meph2/commands/mimport.py'
32--- meph2/commands/mimport.py 2018-09-18 13:44:35 +0000
33+++ meph2/commands/mimport.py 2018-09-18 13:44:35 +0000
34@@ -42,13 +42,21 @@
35 else:
36 raise ValueError("Undefined remote path")
37
38- images = OrderedDict()
39- if args.max == 0:
40- max_items = len(images_unordered)
41+ revision = release_info.get('revision')
42+ if revision:
43+ revision = str(revision)
44+ if revision not in images_unordered:
45+ raise ValueError('Revision %s does not exist!' % revision)
46+ images = {revision: images_unordered[revision]}
47 else:
48- max_items = args.max
49- for key in sorted(images_unordered.keys(), reverse=True)[:max_items]:
50- images[key] = images_unordered[key]
51+ images = OrderedDict()
52+ if args.max == 0:
53+ max_items = len(images_unordered)
54+ else:
55+ max_items = args.max
56+ for key in sorted(
57+ images_unordered.keys(), reverse=True)[:max_items]:
58+ images[key] = images_unordered[key]
59
60 base_url = os.path.dirname(url)
61
62@@ -66,7 +74,8 @@
63 }
64
65 for (revision, image_info) in images.items():
66- version = '20%s01_%02d' % (revision, image_info['release'])
67+ version = '20%s01_%02d' % (
68+ revision, release_info.get('release', image_info['release']))
69 if (
70 product_id in product_tree['products'] and
71 version in product_tree['products'][product_id][

Subscribers

People subscribed via source and target branches