aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorJorge Niedbalski <jorge.niedbalski@linaro.org>2018-05-08 15:47:43 -0300
committerJorge Niedbalski <jorge.niedbalski@linaro.org>2018-05-10 10:39:25 -0300
commit479daab59b4a1faad3a4ab5b7f6ecc4887ffea3a (patch)
treeb98074632e800fa4345c3f77b9345ed9218d33eb /docker
parent59ec7c7cf240da409c293e30ce7f0599542ad7a7 (diff)
downloadkolla-479daab59b4a1faad3a4ab5b7f6ecc4887ffea3a.tar.gz
kolla-479daab59b4a1faad3a4ab5b7f6ecc4887ffea3a.zip
Create symlink if /e/o-d/customer_local_settings exists
Create site-packages custom_local_settings symlink if /etc/openstack-dashboard/custom_ local_settings exists, this will be used as a mechanism to extend the current local_settings without a need to change the file and rebuild the image Change-Id: I06221de3633d1ad30160bfc83d53a3b98f586f39 Partial-Bug: #1769970 Signed-off-by: Jorge Niedbalski <jorge.niedbalski@linaro.org>
Diffstat (limited to 'docker')
-rw-r--r--docker/horizon/extend_start.sh27
1 files changed, 21 insertions, 6 deletions
diff --git a/docker/horizon/extend_start.sh b/docker/horizon/extend_start.sh
index 3fc6a20c2..0c9c04637 100644
--- a/docker/horizon/extend_start.sh
+++ b/docker/horizon/extend_start.sh
@@ -15,6 +15,11 @@ if [[ ${KOLLA_INSTALL_TYPE} == "source" ]] && [[ ! -f ${SITE_PACKAGES}/openstack
${SITE_PACKAGES}/openstack_dashboard/local/local_settings.py
fi
+if [[ -f /etc/openstack-dashboard/custom_local_settings ]] && [[ ! -f ${SITE_PACKAGES}/openstack_dashboard/local/custom_local_settings.py ]]; then
+ ln -s /etc/openstack-dashboard/custom_local_settings \
+ ${SITE_PACKAGES}/openstack_dashboard/local/custom_local_settings.py
+fi
+
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
@@ -251,6 +256,21 @@ function config_zun_dashboard {
done
}
+# NOTE(jeffrey4l, niedbalski): The local_settings and custom_local_settings files
+# affect django-compress behavior, so re-generate the compressed
+# javascript and css if any of those setting files changed
+function settings_changed {
+ declare -A settings=( ['/etc/openstack-dashboard/local_settings']="/var/lib/kolla/.local_settings.md5sum.txt" ['/etc/openstack-dashboard/custom_local_settings']="/var/lib/kolla/.custom_local_settings.md5sum.txt")
+ declare -x changed=1
+ for path in "${!settings[@]}"; do
+ if [[ ! -f ${settings[$path]} || $(md5sum -c --status ${settings[$path]};echo $?) != 0 || ${FORCE_GENERATE} == "yes" ]]; then
+ changed=0
+ md5sum ${path} > ${settings[$path]}
+ fi
+ done
+ return ${changed}
+}
+
config_blazar_dashboard
config_cloudkitty_dashboard
config_designate_dashboard
@@ -286,12 +306,7 @@ else
rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
fi
-# NOTE(jeffrey4l): The local_settings file affect django-compress
-# behavior, so re-generate the compressed javascript and css if it
-# is changed
-MD5SUM_TXT_PATH="/var/lib/kolla/.local_settings.md5sum.txt"
-if [[ ! -f ${MD5SUM_TXT_PATH} || $(md5sum -c --status ${MD5SUM_TXT_PATH};echo $?) != 0 || ${FORCE_GENERATE} == "yes" ]]; then
- md5sum /etc/openstack-dashboard/local_settings > ${MD5SUM_TXT_PATH}
+if settings_changed; then
if [[ "${KOLLA_INSTALL_TYPE}" == "binary" ]]; then
/usr/bin/manage.py collectstatic --noinput --clear
/usr/bin/manage.py compress --force