Merge "Add new keystone.wsgi module"

This commit is contained in:
Zuul 2024-11-22 16:59:26 +00:00 committed by Gerrit Code Review
commit 6269d84ea1
6 changed files with 47 additions and 2 deletions

View File

@ -57,6 +57,7 @@ apidoc_excluded_paths = [
'tests/*',
'tests',
'test',
'wsgi',
# TODO(gmann): with new release of SQLAlchemy(1.4.27) TypeDecorator used
# in common/sql/core.py file started failing. Remove this oncethe issue of
# TypeDecorator is fixed.

View File

@ -1,5 +1,5 @@
[uwsgi]
wsgi-file = /usr/local/bin/keystone-wsgi-admin
module = keystone.wsgi.api:application
# Versions of mod_proxy_uwsgi>=2.0.6 should use a UNIX socket, see
# http://uwsgi-docs.readthedocs.org/en/latest/Apache.html#mod-proxy-uwsgi

View File

@ -1,5 +1,5 @@
[uwsgi]
wsgi-file = /usr/local/bin/keystone-wsgi-public
module = keystone.wsgi.api:application
# Versions of mod_proxy_uwsgi>=2.0.6 should use a UNIX socket, see
# http://uwsgi-docs.readthedocs.org/en/latest/Apache.html#mod-proxy-uwsgi

View File

22
keystone/wsgi/api.py Normal file
View File

@ -0,0 +1,22 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""WSGI application entry-point for Keystone API."""
import threading
from keystone.server import wsgi
application = None
with threading.Lock():
if application is None:
application = wsgi.initialize_public_application()

View File

@ -0,0 +1,22 @@
---
features:
- |
A new module, ``keystone.wsgi``, has been added as a place to gather WSGI
``application`` objects. This is intended to ease deployment by providing
a consistent location for these objects. For example, if using uWSGI then
instead of:
.. code-block:: ini
[uwsgi]
wsgi-file = /bin/keystone-wsgi-public
You can now use:
.. code-block:: ini
[uwsgi]
module = keystone.wsgi.api:application
This also simplifies deployment with other WSGI servers that expect module
paths such as gunicorn.