Merge "Tweaks to allow Horizon dev mode"

This commit is contained in:
Jenkins 2017-07-24 12:06:00 +00:00 committed by Gerrit Code Review
commit b370ccf034
2 changed files with 18 additions and 9 deletions

View File

@ -132,7 +132,6 @@ ADD plugins-archive /
RUN ln -s horizon-source/* horizon \
&& {{ macros.install_pip(horizon_pip_packages | customizable("pip_packages")) }} \
&& mkdir -p /etc/openstack-dashboard \
&& ln -s /etc/openstack-dashboard/local_settings /var/lib/kolla/venv/lib/python2.7/site-packages/openstack_dashboard/local/local_settings.py \
&& cp -r /horizon/openstack_dashboard/conf/* /etc/openstack-dashboard/ \
&& cp /horizon/openstack_dashboard/local/local_settings.py.example /etc/openstack-dashboard/local_settings \
&& cp /horizon/manage.py /var/lib/kolla/venv/bin/manage.py \

View File

@ -2,6 +2,19 @@
set -o errexit
FORCE_GENERATE="${FORCE_GENERATE}"
if [[ ${KOLLA_INSTALL_TYPE} == "binary" ]]; then
SITE_PACKAGES="/usr/lib/python2.7/site-packages"
elif [[ ${KOLLA_INSTALL_TYPE} == "source" ]]; then
SITE_PACKAGES="/var/lib/kolla/venv/lib/python2.7/site-packages"
fi
if [[ ! -f ${SITE_PACKAGES}/openstack_dashboard/local/local_settings.py ]]; then
ln -s /etc/openstack-dashboard/local_settings \
${SITE_PACKAGES}/openstack_dashboard/local/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
@ -13,14 +26,6 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
exit 0
fi
FORCE_GENERATE="no"
if [[ ${KOLLA_INSTALL_TYPE} == "binary" ]]; then
SITE_PACKAGES="/usr/lib/python2.7/site-packages"
elif [[ ${KOLLA_INSTALL_TYPE} == "source" ]]; then
SITE_PACKAGES="/var/lib/kolla/venv/lib/python2.7/site-packages"
fi
function config_dashboard {
ENABLE=$1
SRC=$2
@ -256,6 +261,11 @@ fi
if [[ ! -d "/var/log/kolla/horizon" ]]; then
mkdir -p /var/log/kolla/horizon
fi
if [[ $(stat -c %a /var/log/kolla/horizon) != "755" ]]; then
chmod 755 /var/log/kolla/horizon
fi
if [[ $(stat -c %U ${SITE_PACKAGES}/openstack_dashboard/local/.secret_key_store) != "horizon" ]]; then
chown horizon ${SITE_PACKAGES}/openstack_dashboard/local/.secret_key_store
fi