Merge lp://staging/~danilo/charms/trusty/glance-simplestreams-sync/wait-for-swift into lp://staging/~landscape/charms/trusty/glance-simplestreams-sync/landscape

Proposed by Данило Шеган
Status: Merged
Merged at revision: 60
Proposed branch: lp://staging/~danilo/charms/trusty/glance-simplestreams-sync/wait-for-swift
Merge into: lp://staging/~landscape/charms/trusty/glance-simplestreams-sync/landscape
Diff against target: 26 lines (+7/-2)
1 file modified
scripts/glance-simplestreams-sync.py (+7/-2)
To merge this branch: bzr merge lp://staging/~danilo/charms/trusty/glance-simplestreams-sync/wait-for-swift
Reviewer Review Type Date Requested Status
Chris Glass (community) Approve
Geoff Teale (community) Approve
Review via email: mp+290326@code.staging.launchpad.net

Description of the change

Wait for swift to actually be available before deciding to drop the per-minute cronjob doing the initial sync.

Testing instructions:

1. Deploy OPL
2. Enable openstack-image-refresh feature flag:
   juju ssh landscape-server/0 sudo /opt/canonical/landscape/featureflags enable openstack-image-refresh
2a. Hack /opt/canonical/landscape/canonical/landscape/model/openstack/charms/trusty-stable.json to point glance-simplestreams-sync charm to cs:~danilo/trusty/glance-simplestreams-sync-8
3. Deploy a cloud with OSA
4. Look for log messages in /var/log/glance-simplestreams-sync.log on glance-simplestreams-sync unit, if there's any case where charm_conf['use_swift'] = True and swift_exists=False, it should not lead to a successful "sync done", but instead log "Swift not ready".

NOTE: this is a race condition and we do not always hit it (I've been unable to hit this with this fix in my last 3 deploys, but hit it 2 times before that).

To post a comment you must log in.
Revision history for this message
Geoff Teale (tealeg) wrote :

Just to note that I hit this issue twice in 7 deploys yesterday.

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

+1 - if swift doesn't become available in time then the activity that waits for sync will fail, which is exactly what we want to happen.

review: Approve
Revision history for this message
Chris Glass (tribaal) wrote :

Looks good! No issues on a run. +1

review: Approve

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