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
=== modified file 'conf/centos.yaml'
--- conf/centos.yaml 2018-09-18 13:44:35 +0000
+++ conf/centos.yaml 2018-09-18 13:44:35 +0000
@@ -11,6 +11,12 @@
11 path_version: 711 path_version: 7
12 release_title: "CentOS 7.0"12 release_title: "CentOS 7.0"
13 curtin_files: "{curtin_path}/centos7"13 curtin_files: "{curtin_path}/centos7"
14 # The upstream revision to create MAAS images for. All other versions
15 # are ignored if this is defined.
16 revision: 1808
17 # The lp:maas-images release. This defaults to 01. Changing this will
18 # cause a new build of the revision to be imported.
19 release: 02
14 packages:20 packages:
15 # cloud-init depends on packages from EPEL21 # cloud-init depends on packages from EPEL
16 - epel-release22 - epel-release
@@ -46,6 +52,12 @@
46 version: 6.652 version: 6.6
47 release_title: "CentOS 6.6"53 release_title: "CentOS 6.6"
48 curtin_files: "{curtin_path}/centos6"54 curtin_files: "{curtin_path}/centos6"
55 # The upstream revision to create MAAS images for. All other versions
56 # are ignored if this is defined.
57 revision: 1808
58 # The lp:maas-images release. This defaults to 01. Changing this will
59 # cause a new build of the revision to be imported.
60 release: 02
49 packages:61 packages:
50 # cloud-init depends on packages from EPEL62 # cloud-init depends on packages from EPEL
51 - epel-release63 - epel-release
5264
=== modified file 'meph2/commands/mimport.py'
--- meph2/commands/mimport.py 2018-09-18 13:44:35 +0000
+++ meph2/commands/mimport.py 2018-09-18 13:44:35 +0000
@@ -42,13 +42,21 @@
42 else:42 else:
43 raise ValueError("Undefined remote path")43 raise ValueError("Undefined remote path")
4444
45 images = OrderedDict()45 revision = release_info.get('revision')
46 if args.max == 0:46 if revision:
47 max_items = len(images_unordered)47 revision = str(revision)
48 if revision not in images_unordered:
49 raise ValueError('Revision %s does not exist!' % revision)
50 images = {revision: images_unordered[revision]}
48 else:51 else:
49 max_items = args.max52 images = OrderedDict()
50 for key in sorted(images_unordered.keys(), reverse=True)[:max_items]:53 if args.max == 0:
51 images[key] = images_unordered[key]54 max_items = len(images_unordered)
55 else:
56 max_items = args.max
57 for key in sorted(
58 images_unordered.keys(), reverse=True)[:max_items]:
59 images[key] = images_unordered[key]
5260
53 base_url = os.path.dirname(url)61 base_url = os.path.dirname(url)
5462
@@ -66,7 +74,8 @@
66 }74 }
6775
68 for (revision, image_info) in images.items():76 for (revision, image_info) in images.items():
69 version = '20%s01_%02d' % (revision, image_info['release'])77 version = '20%s01_%02d' % (
78 revision, release_info.get('release', image_info['release']))
70 if (79 if (
71 product_id in product_tree['products'] and80 product_id in product_tree['products'] and
72 version in product_tree['products'][product_id][81 version in product_tree['products'][product_id][

Subscribers

People subscribed via source and target branches