Avoid excessive svc restarts by tracking CONFIG_CHANGED.
This commit is contained in:
parent
a3289c0e3e
commit
48b365dfcd
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
# Common utility functions used across all nova charms.
|
# Common utility functions used across all nova charms.
|
||||||
|
|
||||||
|
CONFIG_CHANGED=False
|
||||||
|
|
||||||
# Load the common OpenStack helper library.
|
# Load the common OpenStack helper library.
|
||||||
if [[ -e $CHARM_DIR/lib/openstack-common ]] ; then
|
if [[ -e $CHARM_DIR/lib/openstack-common ]] ; then
|
||||||
. $CHARM_DIR/lib/openstack-common
|
. $CHARM_DIR/lib/openstack-common
|
||||||
|
@ -49,9 +49,10 @@ function service_ctl {
|
|||||||
juju-log "$CHARM: service_ctl ERROR - Service $i failed to $action"
|
juju-log "$CHARM: service_ctl ERROR - Service $i failed to $action"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
# all configs should have been reloaded on restart, reset flag if its
|
# all configs should have been reloaded on restart of all services, reset
|
||||||
# being used.
|
# flag if its being used.
|
||||||
if [[ "$action" == "restart" ]] && [[ -n "$CONFIG_CHANGED" ]]; then
|
if [[ "$action" == "restart" ]] && [[ -n "$CONFIG_CHANGED" ]] &&
|
||||||
|
[[ "$ctl" == "all" ]]; then
|
||||||
CONFIG_CHANGED="False"
|
CONFIG_CHANGED="False"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user