Skip to content

Commit 01ff037

Browse files
Merge pull request #242 from amoralej/watcher
Enable watcher-dashboard panels if ENABLE_WATCHER is yes
2 parents ee2be24 + bd2fa10 commit 01ff037

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

container-images/kolla/horizon/extend_start.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ HASH_PATH=/var/lib/kolla/.settings.md5sum.txt
77
MANAGE_PY="/usr/bin/python3 /usr/bin/manage.py"
88
PYTHON_VERSION=$(python3 --version | awk '{print $2}' | awk -F'.' '{print $1"."$2}')
99
SITE_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

1113
if [[ -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
105118
config_ironic_dashboard
106119
config_manila_ui
107120
config_octavia_dashboard
121+
config_watcher_dashboard
108122

109123
if settings_changed; then
110124
${MANAGE_PY} collectstatic --noinput --clear

0 commit comments

Comments
 (0)