Merge lp://staging/~danilo/charms/trusty/glance-simplestreams-sync/cloud-uuid into lp://staging/~landscape/charms/trusty/glance-simplestreams-sync/landscape

Proposed by Данило Шеган
Status: Merged
Merged at revision: 58
Proposed branch: lp://staging/~danilo/charms/trusty/glance-simplestreams-sync/cloud-uuid
Merge into: lp://staging/~landscape/charms/trusty/glance-simplestreams-sync/landscape
Diff against target: 206 lines (+127/-3)
4 files modified
config.yaml (+6/-0)
hooks/hooks.py (+3/-2)
scripts/glance-simplestreams-sync.py (+117/-1)
templates/mirrors.yaml (+1/-0)
To merge this branch: bzr merge lp://staging/~danilo/charms/trusty/glance-simplestreams-sync/cloud-uuid
Reviewer Review Type Date Requested Status
Geoff Teale (community) Approve
Chris Glass (community) Approve
Review via email: mp+288798@code.staging.launchpad.net

Description of the change

Pass in a user agent to the cloud image server

This branch monkey-patches UrlMirrorReader in python-simplestreams to allow us to pass in a user agent string to all the requests to cloud images server.

If (a new) charm option cloud_uuid is set, that value is included in the user agent string. This will allow Landscape to set a custom value (eg. OSA-xxx).

To test this, enable "openstack-image-refresh" feature flag (glance-simplestreams-sync will not be deployed without this flag) , deploy a cloud, and then

  juju upgrade-charm --switch cs:~danilo/glance-simplestreams-sync glance-simplestreams-sync

After that, set cloud_uuid option and then watch how /etc/cron.daily/glance-simplestreams-sync job passes user-agent in. For easy testing, I installed apache2 on glance-simplestreams-sync/0 unit, and juju set mirror list to point to http://localhost/releases/ instead of http://cloud-images.ubuntu.com/releases/. I've wgetted the .sjson files it requests and put them into /var/www/html/releases/...

Note: at the same time, I am working on a branch to add user-agent support to python-simplestreams and use that in our version of the charm. Most of this code will go away then, but for now, this allows us to not be blocked on python-simplestreams library getting included in the archives.

To post a comment you must log in.
Revision history for this message
Chris Glass (tribaal) wrote :

Looks good, a slight comment on the charm config name as discussed on IRC, but +1 otherwise.

review: Approve
Revision history for this message
Geoff Teale (tealeg) wrote :

+1 with trivial comments in line.

review: Approve
65. By Данило Шеган

Replace use of cloud_uuid with user_agent charm option.

66. By Данило Шеган

Address other review comments.

Revision history for this message
Данило Шеган (danilo) wrote :

Addressed all the review comments: thanks, guys! Will be landing once I do another round of testing with this charm.

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