Merge "Expose neutron api application as a wsgi script"

This commit is contained in:
Jenkins 2017-04-20 05:53:18 +00:00 committed by Gerrit Code Review
commit 916bc96ee2
3 changed files with 21 additions and 1 deletions

View File

@ -22,9 +22,10 @@ from oslo_config import cfg
from neutron._i18n import _
from neutron.common import config
from neutron.common import profiler
def boot_server(server_func):
def _init_configuration():
# the configuration will be read into the cfg.CONF global data structure
config.init(sys.argv[1:])
config.setup_logging()
@ -33,9 +34,19 @@ def boot_server(server_func):
sys.exit(_("ERROR: Unable to find configuration file via the default"
" search paths (~/.neutron/, ~/, /etc/neutron/, /etc/) and"
" the '--config-file' option!"))
def boot_server(server_func):
_init_configuration()
try:
server_func()
except KeyboardInterrupt:
pass
except RuntimeError as e:
sys.exit(_("ERROR: %s") % e)
def get_application():
_init_configuration()
profiler.setup('neutron-server', cfg.CONF.host)
return config.load_paste_app('neutron')

View File

@ -0,0 +1,7 @@
---
prelude: >
This release adds support for running Neutron API component with a ``mod_wsgi``
compatible web server.
features:
- Neutron API can now be managed by a ``mod_wsgi`` compatible web server (e.g.
``apache2`` (``httpd``), ``nginx``, etc.)

View File

@ -41,6 +41,8 @@ scripts =
bin/neutron-rootwrap-xen-dom0
[entry_points]
wsgi_scripts =
neutron-api = neutron.server:get_application
console_scripts =
neutron-db-manage = neutron.db.migration.cli:main
neutron-debug = neutron.debug.shell:main