@@ -7,6 +7,8 @@ HASH_PATH=/var/lib/kolla/.settings.md5sum.txt
77MANAGE_PY=" /usr/bin/python3 /usr/bin/manage.py"
88PYTHON_VERSION=$( python3 --version | awk ' {print $2}' | awk -F' .' ' {print $1"."$2}' )
99SITE_PACKAGES=" /usr/lib/python${PYTHON_VERSION} /site-packages"
10+ # There may not be ENABLE_WATCHER variable. Defaulting it to no.
11+ ENABLE_WATCHER=" ${ENABLE_WATCHER:- no} "
1012
1113if [[ -f /etc/openstack-dashboard/custom_local_settings ]]; then
1214 CUSTOM_SETTINGS_FILE=" ${SITE_PACKAGES} /openstack_dashboard/local/custom_local_settings.py"
@@ -80,6 +82,17 @@ function config_octavia_dashboard {
8082 " ${SITE_PACKAGES} /openstack_dashboard/local/enabled/_1482_project_load_balancer_panel.py"
8183}
8284
85+ function config_watcher_dashboard {
86+ # Do nothing if the watcher-dashboard is not installed
87+ if [ -d ${SITE_PACKAGES} /watcher_dashboard ] ; then
88+ for file in ${SITE_PACKAGES} /watcher_dashboard/local/enabled/_* [^__].py; do
89+ config_dashboard " ${ENABLE_WATCHER} " \
90+ " ${SITE_PACKAGES} /watcher_dashboard/local/enabled/${file##*/ } " \
91+ " ${SITE_PACKAGES} /openstack_dashboard/local/enabled/${file##*/ } "
92+ done
93+ fi
94+ }
95+
8396# Regenerate the compressed javascript and css if any configuration files have
8497# changed. Use a static modification date when generating the tarball
8598# so that we only trigger on content changes.
@@ -105,6 +118,7 @@ config_heat_dashboard
105118config_ironic_dashboard
106119config_manila_ui
107120config_octavia_dashboard
121+ config_watcher_dashboard
108122
109123if settings_changed; then
110124 ${MANAGE_PY} collectstatic --noinput --clear
0 commit comments