Configure monasca-ui settings in Horizon dir

The default and preferred way of modifying the settings of Horizon
plugin is to add a configuration file to
openstack_dashboard/local/local_settings.d/ directory. For that to work
we should use the settings from django.conf.settings and not from
monitoring.config.local_settings.

[1] https://docs.openstack.org/horizon/latest/configuration/settings.html

Story: 2006556
Task: 36645

Depends-On: https://review.opendev.org/682321
Change-Id: I718b51ce94b09bb547f03686831c3b1ac1721399
This commit is contained in:
Witek Bedyk 2019-09-16 11:40:45 +02:00 committed by Witold Bedyk
parent 313a3ad7af
commit 3f31ba407b
1 changed files with 3 additions and 1 deletions

View File

@ -34,9 +34,11 @@ function configure_ui {
if is_ui_enabled; then
_link_ui_files
cp $MONASCA_UI_DIR/monitoring/config/local_settings.py \
$HORIZON_DIR/openstack_dashboard/local/local_settings.d/_50_monasca_ui_settings.py
sed -e "
s#getattr(settings, 'GRAFANA_URL', None)#{'RegionOne': \"http:\/\/${SERVICE_HOST}:3000\", }#g;
" -i "${MONASCA_BASE}"/monasca-ui/monitoring/config/local_settings.py
" -i $HORIZON_DIR/openstack_dashboard/local/local_settings.d/_50_monasca_ui_settings.py
if python3_enabled; then
DJANGO_SETTINGS_MODULE=openstack_dashboard.settings python3 "${MONASCA_BASE}"/horizon/manage.py collectstatic --noinput
DJANGO_SETTINGS_MODULE=openstack_dashboard.settings python3 "${MONASCA_BASE}"/horizon/manage.py compress --force