diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-11-11 06:20:33 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-11-11 06:20:33 +0000 |
| commit | 88fc252bc0efab812e926a6975cddd2bb7c3f11d (patch) | |
| tree | f56df649ef91ba34e48cc4f8e74bcea8b4b6e99c /docker | |
| parent | 8ca934139ecfae41821d903557dd3842502afef5 (diff) | |
| parent | c89cbff6a225de678d3ae7a3941169a9661fb49a (diff) | |
| download | kolla-88fc252bc0efab812e926a6975cddd2bb7c3f11d.tar.gz kolla-88fc252bc0efab812e926a6975cddd2bb7c3f11d.zip | |
Merge "Fix neutron lbaas dashboard"
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/horizon/Dockerfile.j2 | 8 | ||||
| -rw-r--r-- | docker/horizon/extend_start.sh | 27 |
2 files changed, 30 insertions, 5 deletions
diff --git a/docker/horizon/Dockerfile.j2 b/docker/horizon/Dockerfile.j2 index cdaa8288c..d4a9ab780 100644 --- a/docker/horizon/Dockerfile.j2 +++ b/docker/horizon/Dockerfile.j2 @@ -12,7 +12,8 @@ MAINTAINER {{ maintainer }} 'openstack-dashboard', 'httpd', 'mod_wsgi', - 'gettext' + 'gettext', + 'openstack-neutron-lbaas-ui' ] %} {{ macros.install_packages(horizon_packages | customizable("packages")) }} @@ -27,7 +28,8 @@ RUN useradd --user-group horizon \ && sed -i "s|WEBROOT = '/dashboard/'|WEBROOT = '/'|" /etc/openstack-dashboard/local_settings \ && cp /usr/share/openstack-dashboard/manage.py /usr/bin/manage.py \ && (cd /usr/lib/python2.7/site-packages/horizon && /usr/bin/python /usr/bin/manage.py compilemessages) \ - && (cd /usr/lib/python2.7/site-packages/openstack_dashboard && /usr/bin/python /usr/bin/manage.py compilemessages) + && (cd /usr/lib/python2.7/site-packages/openstack_dashboard && /usr/bin/python /usr/bin/manage.py compilemessages) \ + && rm -f /usr/share/openstack-dashboard/openstack_dashboard/local/enabled/_148*_project*loadbalancersv2_panel.py* {% endblock %} {% elif base_distro in ['ubuntu'] %} @@ -105,8 +107,6 @@ RUN ln -s horizon-source/* horizon \ && cp /horizon/manage.py /var/lib/kolla/venv/bin/manage.py \ && if [ "$(ls /plugins)" ]; then \ pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /plugins/*; \ - ln -s `find /plugins -name 'neutron-lbaas-dashboard-*' -type d`/neutron_lbaas_dashboard/enabled/_1481_project_ng_loadbalancersv2_panel.py \ - /var/lib/kolla/venv/lib/python2.7/site-packages/openstack_dashboard/enabled/_1481_project_ng_loadbalancersv2_panel.py; \ fi \ && (cd /var/lib/kolla/venv/lib/python2.7/site-packages/horizon && /var/lib/kolla/venv/bin/python /var/lib/kolla/venv/bin/manage.py compilemessages) \ && (cd /var/lib/kolla/venv/lib/python2.7/site-packages/openstack_dashboard && /var/lib/kolla/venv/bin/python /var/lib/kolla/venv/bin/manage.py compilemessages) \ diff --git a/docker/horizon/extend_start.sh b/docker/horizon/extend_start.sh index b91afb98e..3c618355d 100644 --- a/docker/horizon/extend_start.sh +++ b/docker/horizon/extend_start.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -o errexit + # 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 @@ -11,6 +13,29 @@ 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_neutron_lbaas { + SRC="${SITE_PACKAGES}/neutron_lbaas_dashboard/enabled/_1481_project_ng_loadbalancersv2_panel.py" + DEST="${SITE_PACKAGES}/openstack_dashboard/local/enabled/_1481_project_ng_loadbalancersv2_panel.py" + if [[ "${ENABLE_NEUTRON_LBAAS}" == "yes" ]] && [[ ! -f ${DEST} ]]; then + cp -a $SRC $DEST + FORCE_GENERATE="yes" + elif [[ "${ENABLE_NEUTRON_LBAAS}" != "yes" ]] && [[ -f ${DEST} ]]; then + # remove pyc pyo files too + rm -f ${DEST} ${DEST}c ${DEST}o + FORCE_GENERATE="yes" + fi +} + +config_neutron_lbaas + # NOTE(pbourke): httpd will not clean up after itself in some cases which # results in the container not being able to restart. (bug #1489676, 1557036) if [[ "${KOLLA_BASE_DISTRO}" =~ debian|ubuntu ]]; then @@ -25,7 +50,7 @@ fi # behavior, so re-generate the compressed javascript and css if it # is changed MD5SUM_TXT_PATH="/tmp/.local_settings.md5sum.txt" -if [[ ! -f ${MD5SUM_TXT_PATH} || $(md5sum -c --status ${MD5SUM_TXT_PATH};echo $?) != 0 ]]; then +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 [[ "${KOLLA_INSTALL_TYPE}" == "binary" ]]; then /usr/bin/manage.py compress --force |
