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
=== modified file 'hooks/glance-common'
--- hooks/glance-common 2013-04-26 21:07:21 +0000
+++ hooks/glance-common 2013-05-22 03:06:28 +0000
@@ -126,6 +126,16 @@
126 juju-log "$CHARM: Configuring identity service after upgrade to $rel."126 juju-log "$CHARM: Configuring identity service after upgrade to $rel."
127 keystone_changed $r_id127 keystone_changed $r_id
128 fi128 fi
129
130 local ceph_ids="$(relation-ids ceph)"
131 [[ -n "$ceph_ids" ]] && apt-get -y install librbd1
132 for r_id in $ceph_ids ; do
133 for unit in $(relation-list -r $r_id) ; do
134 ceph_changed "$r_id" "$unit"
135 done
136 done
137
138 [[ -n "$(relation-ids object-store)" ]] && object-store_joined
129}139}
130140
131configure_https() {141configure_https() {
132142
=== modified file 'hooks/glance-relations'
--- hooks/glance-relations 2013-04-26 21:07:51 +0000
+++ hooks/glance-relations 2013-05-22 03:06:28 +0000
@@ -145,9 +145,13 @@
145}145}
146146
147function ceph_changed {147function ceph_changed {
148 local r_id="$1"
149 local unit_id="$2"
150 local r_arg=""
151 [[ -n "$r_id" ]] && r_arg="-r $r_id"
148 SERVICE_NAME=`echo $JUJU_UNIT_NAME | cut -d / -f 1`152 SERVICE_NAME=`echo $JUJU_UNIT_NAME | cut -d / -f 1`
149 KEYRING=/etc/ceph/ceph.client.$SERVICE_NAME.keyring153 KEYRING=/etc/ceph/ceph.client.$SERVICE_NAME.keyring
150 KEY=`relation-get key`154 KEY=`relation-get $r_arg key $unit_id`
151 if [ -n "$KEY" ]; then155 if [ -n "$KEY" ]; then
152 # But only once156 # But only once
153 if [ ! -f $KEYRING ]; then157 if [ ! -f $KEYRING ]; then
@@ -161,14 +165,14 @@
161 exit 0165 exit 0
162 fi166 fi
163167
164 MONS=`relation-list`168 MONS=`relation-list $r_arg`
165 mon_hosts=""169 mon_hosts=""
166 for mon in $MONS; do170 for mon in $MONS; do
167 mon_hosts="$mon_hosts`relation-get private-address $mon`:6789,"171 mon_hosts="$mon_hosts`relation-get $r_arg private-address $mon`:6789,"
168 done172 done
169 cat > /etc/ceph/ceph.conf << EOF173 cat > /etc/ceph/ceph.conf << EOF
170[global]174[global]
171 auth supported = $(relation-get auth)175 auth supported = $(relation-get $r_arg auth $unit_id)
172 keyring = /etc/ceph/\$cluster.\$name.keyring176 keyring = /etc/ceph/\$cluster.\$name.keyring
173 mon host = $mon_hosts177 mon host = $mon_hosts
174EOF178EOF
175179
=== modified file 'revision'
--- revision 2013-04-26 21:09:06 +0000
+++ revision 2013-05-22 03:06:28 +0000
@@ -1,1 +1,1 @@
11411142

Subscribers

People subscribed via source and target branches