Add WSGI support for cloudkitty-api

They dropped the cloudkitty-api command line[0], so we should add wsgi
support for cloudkitty-api.

[0]https://review.openstack.org/#/c/366043/

Change-Id: Ie6a08831f8c0bcf3051f01fccc9e3662f36b03ca
Closes-Bug: #1713879
This commit is contained in:
ZhongShengping 2017-08-24 11:03:12 +08:00
parent 7b3e9c595c
commit 14df9701b5
2 changed files with 37 additions and 3 deletions

View File

@ -9,8 +9,14 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set cloudkitty_api_packages = [
'httpd',
'mod_ssl',
'mod_wsgi',
'openstack-cloudkitty-api',
] %}
{{ macros.install_packages(cloudkitty_api_packages | customizable("packages")) }}
RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
&& sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf
{% elif base_distro in ['debian', 'ubuntu'] %}
@ -19,14 +25,32 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
{% endif %}
{% endif %}
{% elif install_type == 'source' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set cloudkitty_api_packages = [
'httpd',
'mod_ssl',
'mod_wsgi'
] %}
{{ macros.install_packages(cloudkitty_api_packages | customizable("packages")) }}
RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
&& sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf
{% elif base_distro in ['ubuntu', 'debian'] %}
{% set cloudkitty_api_packages = [
'apache2',
'libapache2-mod-wsgi'
] %}
{{ macros.install_packages(cloudkitty_api_packages | customizable("packages")) }}
RUN echo > /etc/apache2/ports.conf
{% endif %}
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_cloudkitty_extend_start
RUN chmod 755 /usr/local/bin/kolla_cloudkitty_extend_start
{% block cloudkitty_api_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER cloudkitty

View File

@ -1,5 +1,15 @@
#!/bin/bash
# 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
# Loading Apache2 ENV variables
. /etc/apache2/envvars
rm -rf /var/run/apache2/*
else
rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
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