From deb3ff50f15bc89921ea548f5b53d49492c5ee65 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Wed, 24 Jul 2019 17:08:44 +0900 Subject: [PATCH] lib/horizon: no need to specify keystone v3 to API version keystone v3 is the default API version in horizon now, so there is no need to specify it in local_settings.py explicitly. This commit also makes minor changes in lib/horizon _horizon_config_set(). * Do not insert a blank line after each setting. * Use the local variable $file to specify the target file consistently. Change-Id: I5faea3e1f357726a256d2b48fc1afeabfead4998 --- lib/horizon | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/horizon b/lib/horizon index 293a627c78..b2bf7bcb49 100644 --- a/lib/horizon +++ b/lib/horizon @@ -43,8 +43,8 @@ function _horizon_config_set { local value=$4 if [ -z "$section" ]; then - sed -e "/^$option/d" -i $local_settings - echo -e "\n$option=$value" >> $file + sed -e "/^$option/d" -i $file + echo "$option = $value" >> $file elif grep -q "^$section" $file; then local line line=$(sed -ne "/^$section/,/^}/ { /^ *'$option':/ p; }" $file) @@ -84,6 +84,9 @@ function configure_horizon { local local_settings=$HORIZON_DIR/openstack_dashboard/local/local_settings.py cp $HORIZON_SETTINGS $local_settings + # Ensure local_setting.py file ends with EOL (newline) + echo >> $local_settings + _horizon_config_set $local_settings "" WEBROOT \"$HORIZON_APACHE_ROOT/\" _horizon_config_set $local_settings "" COMPRESS_OFFLINE True @@ -91,7 +94,6 @@ function configure_horizon { _horizon_config_set $local_settings "" OPENSTACK_HOST \"${KEYSTONE_SERVICE_HOST}\" - _horizon_config_set $local_settings "" OPENSTACK_API_VERSIONS {\"identity\":3} _horizon_config_set $local_settings "" OPENSTACK_KEYSTONE_URL "\"${KEYSTONE_SERVICE_URI}/v3\"" # note(trebskit): if HOST_IP points at non-localhost ip address, horizon cannot be accessed