Avoid excessive svc restarts by tracking CONFIG_CHANGED.

This commit is contained in:
Adam Gandelman 2013-04-04 19:34:22 -04:00
parent a3289c0e3e
commit 48b365dfcd
3 changed files with 7 additions and 4 deletions

View File

@ -2,6 +2,8 @@
# Common utility functions used across all nova charms.
CONFIG_CHANGED=False
# Load the common OpenStack helper library.
if [[ -e $CHARM_DIR/lib/openstack-common ]] ; then
. $CHARM_DIR/lib/openstack-common

View File

@ -49,9 +49,10 @@ function service_ctl {
juju-log "$CHARM: service_ctl ERROR - Service $i failed to $action"
fi
done
# all configs should have been reloaded on restart, reset flag if its
# being used.
if [[ "$action" == "restart" ]] && [[ -n "$CONFIG_CHANGED" ]]; then
# all configs should have been reloaded on restart of all services, reset
# flag if its being used.
if [[ "$action" == "restart" ]] && [[ -n "$CONFIG_CHANGED" ]] &&
[[ "$ctl" == "all" ]]; then
CONFIG_CHANGED="False"
fi
}

View File

@ -1 +1 @@
240
261