summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2019-10-01 08:23:09 +0000
committerGerrit Code Review <review@openstack.org>2019-10-01 08:23:09 +0000
commit9b199efd9b25ff52058e5216a1c7ee47a2eae5cb (patch)
tree29c34960c92a69cf9c9de2baf52bb458a38c0be2 /docker
parentbaf9a10da0a7b7cf7047b4ba4905f69ace48803e (diff)
parent6f44a3282aeeef90caaba48daae068493e2b8606 (diff)
downloadkolla-9b199efd9b25ff52058e5216a1c7ee47a2eae5cb.tar.gz
kolla-9b199efd9b25ff52058e5216a1c7ee47a2eae5cb.zip
Merge "Horizon: fix for Debian"
Diffstat (limited to 'docker')
-rw-r--r--docker/horizon/Dockerfile.j220
-rw-r--r--docker/horizon/extend_start.sh13
2 files changed, 24 insertions, 9 deletions
diff --git a/docker/horizon/Dockerfile.j2 b/docker/horizon/Dockerfile.j2
index 0686e2644..48bdcd1d6 100644
--- a/docker/horizon/Dockerfile.j2
+++ b/docker/horizon/Dockerfile.j2
@@ -69,9 +69,15 @@ RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
'python3-octavia-dashboard',
'python3-sahara-dashboard',
'python3-trove-dashboard',
- 'tzdata'
+ 'tzdata',
] %}
- #NOTE(hrw): check for python-murano-dashboard
+ {% if base_distro == 'debian' %}
+ {% set horizon_packages = horizon_packages + [
+ 'python3-neutron-fwaas-dashboard',
+ 'python3-neutron-vpnaas-dashboard',
+ ] %}
+ {% endif %}
+ #NOTE(hrw): check for python-murano-dashboard
{{ macros.install_packages(horizon_packages | customizable("packages")) }}
@@ -80,14 +86,20 @@ RUN echo > /etc/apache2/ports.conf \
&& sed -i 's|\(ServerTokens \)OS|\1Prod|' /etc/apache2/conf-available/security.conf \
&& ln -s ../mods-available/headers.load /etc/apache2/mods-enabled/headers.load \
&& ln -s ../mods-available/expires.load /etc/apache2/mods-enabled/expires.load \
+ {% if base_distro == 'ubuntu' %}
&& cp /usr/share/openstack-dashboard/openstack_dashboard/conf/*.json /etc/openstack-dashboard \
- && cp /usr/share/openstack-dashboard/manage.py /usr/bin/manage.py \
&& rm /etc/apache2/conf-enabled/openstack-dashboard.conf \
+ {% endif %}
+ && cp /usr/share/openstack-dashboard/manage.py /usr/bin/manage.py \
&& rm /etc/openstack-dashboard/local_settings.py \
&& ln -s /etc/openstack-dashboard/local_settings /etc/openstack-dashboard/local_settings.py \
&& for locale in /usr/lib/python3/dist-packages/*/locale; do \
(cd ${locale%/*} && /usr/bin/django-admin compilemessages) \
- done
+ done {% if install_type == 'binary' and base_distro == 'debian' %} \
+ && find /etc/openstack-dashboard/enabled/ -type f | grep -Ev \
+ `dpkg -L openstack-dashboard python3-django-horizon | \
+ grep '/etc/openstack-dashboard/enabled/' | sed 's/\.py/.*.py/g' |xargs -l1 basename | xargs | tr ' ' '|'` | xargs rm
+ {% endif %}
{% endblock %}
{% endif %}
diff --git a/docker/horizon/extend_start.sh b/docker/horizon/extend_start.sh
index 857bdfdfd..a2bc79e13 100644
--- a/docker/horizon/extend_start.sh
+++ b/docker/horizon/extend_start.sh
@@ -5,11 +5,6 @@ set -o errexit
FORCE_GENERATE="${FORCE_GENERATE}"
HASH_PATH=/var/lib/kolla/.settings.md5sum.txt
-# TODO(mgoddard): Remove this elif when Ubuntu has distro_python_version == 3.
-if [[ ${KOLLA_INSTALL_TYPE} == "binary" ]] && [[ "${KOLLA_BASE_DISTRO}" =~ ubuntu ]]; then
- KOLLA_DISTRO_PYTHON_VERSION=3
-fi
-
if [[ ${KOLLA_INSTALL_TYPE} == "binary" ]]; then
if [[ ${KOLLA_BASE_DISTRO} == "debian" ]] || [[ ${KOLLA_BASE_DISTRO} == "ubuntu" ]]; then
SITE_PACKAGES="/usr/lib/python3/dist-packages"
@@ -29,6 +24,10 @@ fi
if [[ ${KOLLA_INSTALL_TYPE} == "source" ]] && [[ ! -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
+elif [[ ${KOLLA_BASE_DISTRO} == "debian" ]] && [[ ${KOLLA_INSTALL_TYPE} == "binary" ]]; then
+ rm -f ${SITE_PACKAGES}/openstack_dashboard/local/local_settings.py
+ ln -s /etc/openstack-dashboard/local_settings \
+ ${SITE_PACKAGES}/openstack_dashboard/local/local_settings.py
fi
if [[ -f /etc/openstack-dashboard/custom_local_settings ]]; then
@@ -362,6 +361,10 @@ if [[ "${KOLLA_BASE_DISTRO}" =~ debian|ubuntu ]]; then
# Loading Apache2 ENV variables
. /etc/apache2/envvars
install -d /var/run/apache2/
+ if [[ "${KOLLA_BASE_DISTRO}" == "debian" ]] && [[ ${KOLLA_INSTALL_TYPE} == "binary" ]]; then
+ APACHE_RUN_GROUP=horizon
+ APACHE_RUN_USER=horizon
+ fi
rm -rf /var/run/apache2/*
else
rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*