Expose neutron api application as a wsgi script
This can then be loaded into a wsgi compatible web server like apache2/httpd or nginx. DocImpact A new neutron-api script is installed, and can be used to start either a standalone wsgi server (calling the script directly), or as a wsgi script loaded by a web server (e.g. by httpd/mod_wsgi). Change-Id: Ie9bb8b33f6e1335219e574d832ac264b043d90e6 Partial-Bug: #1666779 Co-Authored-By: Brandon Logan <brandon.logan@rackspace.com> Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
This commit is contained in:
parent
f9b9474e8c
commit
429703a9a8
@ -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')
|
||||
|
@ -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.)
|
Loading…
Reference in New Issue
Block a user