Make ironic-api compatible with WSGI containers other than mod_wsgi
Using ironic-api-wsgi implies mod_wsgi, some other containers require an importable module. This patch modifies ironic.api.wsgi to be usable this way and documents it. Change-Id: I8493eb36293a0214081e0adb59c3a267c9688819
This commit is contained in:
parent
443e0b1093
commit
4504bd5a8d
@ -74,3 +74,20 @@ Bare Metal service comes with an example file for configuring the
|
|||||||
.. note::
|
.. note::
|
||||||
The file ``ironic-api-wsgi`` is automatically generated by pbr and is
|
The file ``ironic-api-wsgi`` is automatically generated by pbr and is
|
||||||
available in `IRONIC_BIN` directory. It should not be modified.
|
available in `IRONIC_BIN` directory. It should not be modified.
|
||||||
|
|
||||||
|
Configure another WSGI container
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
A slightly different approach has to be used for WSGI containers that cannot
|
||||||
|
use ``ironic-api-wsgi``. For example, for *gunicorn*:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
gunicorn -b 0.0.0.0:6385 'ironic.api.wsgi:initialize_wsgi_app(argv=[])'
|
||||||
|
|
||||||
|
If you want to pass a configuration file, use:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
gunicorn -b 0.0.0.0:6385 \
|
||||||
|
'ironic.api.wsgi:initialize_wsgi_app(argv=["ironic-api", "--config-file=/path/to/_ironic.conf"])'
|
||||||
|
@ -25,10 +25,11 @@ CONF = cfg.CONF
|
|||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def initialize_wsgi_app():
|
# NOTE(dtantsur): WSGI containers may need to override the passed argv.
|
||||||
|
def initialize_wsgi_app(argv=sys.argv):
|
||||||
i18n.install('ironic')
|
i18n.install('ironic')
|
||||||
|
|
||||||
service.prepare_service(sys.argv)
|
service.prepare_service(argv)
|
||||||
|
|
||||||
LOG.debug("Configuration:")
|
LOG.debug("Configuration:")
|
||||||
CONF.log_opt_values(LOG, log.DEBUG)
|
CONF.log_opt_values(LOG, log.DEBUG)
|
||||||
|
7
releasenotes/notes/any-wsgi-8d6ccb0590104146.yaml
Normal file
7
releasenotes/notes/any-wsgi-8d6ccb0590104146.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Makes ``ironic.api.wsgi`` compatible with WSGI containers that cannot use
|
||||||
|
an executable WSGI entry point. For example, with gunicorn::
|
||||||
|
|
||||||
|
gunicorn -b 0.0.0.0:6385 'ironic.api.wsgi:initialize_wsgi_app(argv=[])'
|
Loading…
x
Reference in New Issue
Block a user