Merge lp://staging/~ltrager/maas-images/rename_centos into lp://staging/maas-images

Proposed by Lee Trager
Status: Merged
Merged at revision: 254
Proposed branch: lp://staging/~ltrager/maas-images/rename_centos
Merge into: lp://staging/maas-images
Diff against target: 173 lines (+35/-48)
2 files modified
conf/centos.yaml (+2/-2)
meph2/commands/meph2_util.py (+33/-46)
To merge this branch: bzr merge lp://staging/~ltrager/maas-images/rename_centos
Reviewer Review Type Date Requested Status
Scott Moser Pending
Review via email: mp+276303@code.staging.launchpad.net

Commit message

Rename centos products to include 'daily'

 * Renames the CentOS images to include 'daily' in the product name
   This follows the convention of the ubuntu daily images.
 * Fixes a bug when the SHA256 sums don't match meph2-util would crash
   because it was trying to read the wrong variable
 * Adds the sign command to sign the stream with your gpg key

Description of the change

This patch does the following

* Renames the CentOS images to include 'daily' in the name
* Fixes a bug when the SHA256 sums don't match meph2-util would crash because it was trying to read the wrong variable
* Adds the sign command to sign the stream with your gpg key

We can rename the existing daily stream with the following

STREAM_PATH="/path/to/daily/streams/v1"
rm ${STREAM_PATH}/*.sjson ${STREAM_PATH}/*.json.gpg
mv "${STREAM_PATH}/com.ubuntu.maas:centos-bases-download.json" \
    "${STREAM_PATH}/com.ubuntu.maas:daily:centos-bases-download.json"
sed -i \
    -e 's/com.canonical.maas:centos-bases/com.ubuntu.maas.daily:centos-bases/g' \
    -e 's/"label": "release"/"label": "daily"/g' \
    ${STREAM_PATH}/*.json
meph2-util sign /path/to/daily

I've confirmed that after using the above script to rename the centos images the import command does not regenerate the centos images and MAAS does not redownload them.

I was also able to confirm that the following command successfully promotes a centos image into a stream which currently has none
meph2-util promote --no-sign --label=release /path/to/daily /path/to/releases 20141129_01 release=centos70 product_name=com.ubuntu.maas.daily:centos-bases:7.0:amd64

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

Will maas re-download ?
I'd consider it not a show stopper if it did, but less than ideal.

one other minor thing in line.

246. By Lee Trager

Use one function for signing

Revision history for this message
Lee Trager (ltrager) wrote :

Sorry it took so long to get back to you, this completely feel off my radar. The rename will not regenerate the images if we run the commands above before running the import command again.

247. By Lee Trager

Fix tox errors

248. By Lee Trager

Newly imported images should use daily label

Revision history for this message
Lee Trager (ltrager) wrote :

It doesn't look like MAAS redownloads images if the name changes, it looking at the hash.

How I tested:
1. Setup MAAS trunk
2. Point boot images to a local mirror I have of http://maas.ubuntu.com/images/ephemeral-v2/daily
3. Download Ubuntu Trusty, CentOS 6.6, and CentOS 7.0
4. Follow the rename steps above on my local mirror
5. Reload images with maas <profile> boot-source update 1
6. Verify time stamps didn't change in /var/lib/maas/boot-resources/current/centos/amd64/generic/centos70/daily
7. Check /var/log/apache2/access.log on local mirror that only json files have been requested.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches