Merge lp:~gandelman-a/charms/precise/nova-compute/avoid_restarts into lp:~openstack-charmers/charms/precise/nova-compute/ha-support

Proposed by Adam Gandelman
Status: Merged
Merged at revision: 55
Proposed branch: lp:~gandelman-a/charms/precise/nova-compute/avoid_restarts
Merge into: lp:~openstack-charmers/charms/precise/nova-compute/ha-support
Diff against target: 146 lines (+38/-13)
8 files modified
hooks/lib/nova/essex (+1/-0)
hooks/lib/nova/folsom (+1/-0)
hooks/lib/nova/grizzly (+1/-0)
hooks/lib/nova/nova-common (+2/-0)
hooks/lib/openstack-common (+13/-1)
hooks/nova-compute-common (+2/-0)
hooks/nova-compute-relations (+17/-11)
revision (+1/-1)
To merge this branch: bzr merge lp:~gandelman-a/charms/precise/nova-compute/avoid_restarts
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+157483@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/lib/nova/essex'
--- hooks/lib/nova/essex 2012-12-17 23:27:41 +0000
+++ hooks/lib/nova/essex 2013-04-05 20:56:24 +0000
@@ -39,4 +39,5 @@
39 juju-log "$CHARM: Setting new option $key=$value in $conf_file"39 juju-log "$CHARM: Setting new option $key=$value in $conf_file"
40 echo "$out$value" >>$conf_file40 echo "$out$value" >>$conf_file
41 fi41 fi
42 CONFIG_CHANGED=True
42}43}
4344
=== modified file 'hooks/lib/nova/folsom'
--- hooks/lib/nova/folsom 2012-12-17 23:45:59 +0000
+++ hooks/lib/nova/folsom 2013-04-05 20:56:24 +0000
@@ -62,6 +62,7 @@
62 fi62 fi
63 ;;63 ;;
64 esac64 esac
65 CONFIG_CHANGED="True"
65}66}
6667
67# Upgrade Helpers68# Upgrade Helpers
6869
=== modified file 'hooks/lib/nova/grizzly'
--- hooks/lib/nova/grizzly 2012-12-22 00:55:24 +0000
+++ hooks/lib/nova/grizzly 2013-04-05 20:56:24 +0000
@@ -63,6 +63,7 @@
63 fi63 fi
64 ;;64 ;;
65 esac65 esac
66 CONFIG_CHANGED="True"
66}67}
6768
68# Upgrade Helpers69# Upgrade Helpers
6970
=== modified file 'hooks/lib/nova/nova-common'
--- hooks/lib/nova/nova-common 2013-01-08 23:25:48 +0000
+++ hooks/lib/nova/nova-common 2013-04-05 20:56:24 +0000
@@ -2,6 +2,8 @@
22
3# Common utility functions used across all nova charms.3# Common utility functions used across all nova charms.
44
5CONFIG_CHANGED=False
6
5# Load the common OpenStack helper library.7# Load the common OpenStack helper library.
6if [[ -e $CHARM_DIR/lib/openstack-common ]] ; then8if [[ -e $CHARM_DIR/lib/openstack-common ]] ; then
7 . $CHARM_DIR/lib/openstack-common9 . $CHARM_DIR/lib/openstack-common
810
=== modified file 'hooks/lib/openstack-common'
--- hooks/lib/openstack-common 2013-03-15 19:08:54 +0000
+++ hooks/lib/openstack-common 2013-04-05 20:56:24 +0000
@@ -20,6 +20,9 @@
2020
21function service_ctl {21function service_ctl {
22 # control a specific service, or all (as defined by $SERVICES)22 # control a specific service, or all (as defined by $SERVICES)
23 # service restarts will only occur depending on global $CONFIG_CHANGED,
24 # which should be updated in charm's set_or_update().
25 local config_changed=${CONFIG_CHANGED:-True}
23 if [[ $1 == "all" ]] ; then26 if [[ $1 == "all" ]] ; then
24 ctl="$SERVICES"27 ctl="$SERVICES"
25 else28 else
@@ -37,12 +40,21 @@
37 "stop")40 "stop")
38 service_ctl_status $i && service $i stop || return 0 ;;41 service_ctl_status $i && service $i stop || return 0 ;;
39 "restart")42 "restart")
40 service_ctl_status $i && service $i restart || service $i start ;;43 if [[ "$config_changed" == "True" ]] ; then
44 service_ctl_status $i && service $i restart || service $i start
45 fi
46 ;;
41 esac47 esac
42 if [[ $? != 0 ]] ; then48 if [[ $? != 0 ]] ; then
43 juju-log "$CHARM: service_ctl ERROR - Service $i failed to $action"49 juju-log "$CHARM: service_ctl ERROR - Service $i failed to $action"
44 fi50 fi
45 done51 done
52 # all configs should have been reloaded on restart of all services, reset
53 # flag if its being used.
54 if [[ "$action" == "restart" ]] && [[ -n "$CONFIG_CHANGED" ]] &&
55 [[ "$ctl" == "all" ]]; then
56 CONFIG_CHANGED="False"
57 fi
46}58}
4759
48function configure_install_source {60function configure_install_source {
4961
=== modified file 'hooks/nova-compute-common'
--- hooks/nova-compute-common 2013-03-25 16:23:50 +0000
+++ hooks/nova-compute-common 2013-04-05 20:56:24 +0000
@@ -124,6 +124,8 @@
124 local keystone_host=$(relation-get keystone_host)124 local keystone_host=$(relation-get keystone_host)
125 [[ -z $keystone_host ]] && juju-log "nova-compute: Missing keystone host" \125 [[ -z $keystone_host ]] && juju-log "nova-compute: Missing keystone host" \
126 && exit 0126 && exit 0
127 # XXX(adam_g): Need to check for unset values here, otherwise it errors
128 # if nova-c-c<->nova-compute is made before keystone<->nova-c-c
127 set_or_update "network_api_class" "nova.network.quantumv2.api.API"129 set_or_update "network_api_class" "nova.network.quantumv2.api.API"
128 set_or_update "quantum_auth_strategy" "keystone"130 set_or_update "quantum_auth_strategy" "keystone"
129 set_or_update "quantum_url" "$(relation-get quantum_url)"131 set_or_update "quantum_url" "$(relation-get quantum_url)"
130132
=== modified file 'hooks/nova-compute-relations'
--- hooks/nova-compute-relations 2013-04-04 20:48:36 +0000
+++ hooks/nova-compute-relations 2013-04-05 20:56:24 +0000
@@ -178,21 +178,27 @@
178 done178 done
179 # Rabbit MQ relation may also already be in place179 # Rabbit MQ relation may also already be in place
180 # shared vhost with nova so just grab settings and180 # shared vhost with nova so just grab settings and
181 # configure181 # configure. need to be sure to use VIP if clustered.
182 local rabbit_clustered="" rabbit_vip="" rabbit_host="" rabbit_password=""
182 r_ids="$(relation-ids amqp)"183 r_ids="$(relation-ids amqp)"
183 for id in $r_ids ; do184 for id in $r_ids ; do
184 for unit in $(relation-list -r $id) ; do185 for unit in $(relation-list -r $id) ; do
185 local rabbit_host=$(relation-get -r $id private-address $unit)186 rabbit_clustered=$(relation-get -r $id clustered $unit)
186 local rabbit_password=$(relation-get -r $id password $unit)187 rabbit_vip=$(relation-get -r $id vip $unit)
187 if [[ -n $rabbit_host ]] && \188 rabbit_host=$(relation-get -r $id private-address $unit)
188 [[ -n $rabbit_password ]]; then189 rabbit_password=$(relation-get -r $id password $unit)
189 set_or_update rabbit_host "$rabbit_host" "$QUANTUM_CONF"190 done
190 set_or_update rabbit_userid "$(config-get rabbit-user)" "$QUANTUM_CONF"
191 set_or_update rabbit_password "$rabbit_password" "$QUANTUM_CONF"
192 set_or_update rabbit_virtual_host "$(config-get rabbit-vhost)" "$QUANTUM_CONF"
193 fi
194 done
195 done191 done
192 if [[ -n "$rabbit_clustered" ]] ; then
193 rabbit_host="$rabbit_vip"
194 fi
195 if [[ -n $rabbit_host ]] && \
196 [[ -n $rabbit_password ]]; then
197 set_or_update rabbit_host "$rabbit_host" "$QUANTUM_CONF"
198 set_or_update rabbit_userid "$(config-get rabbit-user)" "$QUANTUM_CONF"
199 set_or_update rabbit_password "$rabbit_password" "$QUANTUM_CONF"
200 set_or_update rabbit_virtual_host "$(config-get rabbit-vhost)" "$QUANTUM_CONF"
201 fi
196 else202 else
197 configure_network_manager "$network_manager"203 configure_network_manager "$network_manager"
198 fi204 fi
199205
=== modified file 'revision'
--- revision 2013-04-04 20:48:36 +0000
+++ revision 2013-04-05 20:56:24 +0000
@@ -1,1 +1,1 @@
188189

Subscribers

People subscribed via source and target branches