Merge lp:~gandelman-a/charms/precise/glance/upgrade into lp:~openstack-charmers/charms/precise/glance/ha-support

Proposed by Adam Gandelman
Status: Merged
Merged at revision: 52
Proposed branch: lp:~gandelman-a/charms/precise/glance/upgrade
Merge into: lp:~openstack-charmers/charms/precise/glance/ha-support
Diff against target: 64 lines (+19/-5)
3 files modified
hooks/glance-common (+10/-0)
hooks/glance-relations (+8/-4)
revision (+1/-1)
To merge this branch: bzr merge lp:~gandelman-a/charms/precise/glance/upgrade
Reviewer Review Type Date Requested Status
James Page Approve
Review via email: mp+165003@code.launchpad.net

Description of the change

Adds upgrade support with existing ceph + swift relations. Both tested okay and images could be added and retrieved after upgrade for both backend.

To post a comment you must log in.
Revision history for this message
James Page (james-page) wrote :

Same comment as for cinder - I'd upgrade the _joined dependency:

+ [[ -n "$ceph_ids" ]] && apt-get -y install librbd1

In this case:

ceph-common python-ceph

Other than that works for me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/glance-common'
2--- hooks/glance-common 2013-04-26 21:07:21 +0000
3+++ hooks/glance-common 2013-05-22 03:06:28 +0000
4@@ -126,6 +126,16 @@
5 juju-log "$CHARM: Configuring identity service after upgrade to $rel."
6 keystone_changed $r_id
7 fi
8+
9+ local ceph_ids="$(relation-ids ceph)"
10+ [[ -n "$ceph_ids" ]] && apt-get -y install librbd1
11+ for r_id in $ceph_ids ; do
12+ for unit in $(relation-list -r $r_id) ; do
13+ ceph_changed "$r_id" "$unit"
14+ done
15+ done
16+
17+ [[ -n "$(relation-ids object-store)" ]] && object-store_joined
18 }
19
20 configure_https() {
21
22=== modified file 'hooks/glance-relations'
23--- hooks/glance-relations 2013-04-26 21:07:51 +0000
24+++ hooks/glance-relations 2013-05-22 03:06:28 +0000
25@@ -145,9 +145,13 @@
26 }
27
28 function ceph_changed {
29+ local r_id="$1"
30+ local unit_id="$2"
31+ local r_arg=""
32+ [[ -n "$r_id" ]] && r_arg="-r $r_id"
33 SERVICE_NAME=`echo $JUJU_UNIT_NAME | cut -d / -f 1`
34 KEYRING=/etc/ceph/ceph.client.$SERVICE_NAME.keyring
35- KEY=`relation-get key`
36+ KEY=`relation-get $r_arg key $unit_id`
37 if [ -n "$KEY" ]; then
38 # But only once
39 if [ ! -f $KEYRING ]; then
40@@ -161,14 +165,14 @@
41 exit 0
42 fi
43
44- MONS=`relation-list`
45+ MONS=`relation-list $r_arg`
46 mon_hosts=""
47 for mon in $MONS; do
48- mon_hosts="$mon_hosts`relation-get private-address $mon`:6789,"
49+ mon_hosts="$mon_hosts`relation-get $r_arg private-address $mon`:6789,"
50 done
51 cat > /etc/ceph/ceph.conf << EOF
52 [global]
53- auth supported = $(relation-get auth)
54+ auth supported = $(relation-get $r_arg auth $unit_id)
55 keyring = /etc/ceph/\$cluster.\$name.keyring
56 mon host = $mon_hosts
57 EOF
58
59=== modified file 'revision'
60--- revision 2013-04-26 21:09:06 +0000
61+++ revision 2013-05-22 03:06:28 +0000
62@@ -1,1 +1,1 @@
63-141
64+142

Subscribers

People subscribed via source and target branches