Merge "Configures horizon lbaas dashboard"

This commit is contained in:
Jenkins 2013-03-14 22:04:55 +00:00 committed by Gerrit Code Review
commit 475ef00b52

View File

@ -34,6 +34,24 @@ HORIZON_DIR=$DEST/horizon
APACHE_USER=${APACHE_USER:-$USER}
APACHE_GROUP=${APACHE_GROUP:-$(id -gn $APACHE_USER)}
# utility method of setting python option
function _horizon_config_set() {
local file=$1
local section=$2
local option=$3
local value=$4
if grep -q "^$section" $file; then
line=$(sed -ne "/^$section/,/^}/ { /^ *'$option':/ p; }" $file)
if [ -n "$line" ]; then
sed -i -e "/^$section/,/^}/ s/^\( *'$option'\) *:.*$/\1: $value,/" $file
else
sed -i -e "/^$section/ a\n '$option': $value,\n" $file
fi
else
echo -e "\n\n$section = {\n '$option': $value,\n}" >> $file
fi
}
# Entry Points
# ------------
@ -61,6 +79,11 @@ function init_horizon() {
local_settings=$HORIZON_DIR/openstack_dashboard/local/local_settings.py
cp $FILES/horizon_settings.py $local_settings
# enable loadbalancer dashboard in case service is enabled
if is_service_enabled q-lbaas; then
_horizon_config_set $local_settings OPENSTACK_QUANTUM_NETWORK enable_lb True
fi
# Initialize the horizon database (it stores sessions and notices shown to
# users). The user system is external (keystone).
cd $HORIZON_DIR