From 70a42e7a82ddae9be75dba8f063170a1d13ce301 Mon Sep 17 00:00:00 2001 From: Tom Cocozzello Date: Tue, 29 Sep 2015 11:07:09 -0500 Subject: [PATCH] Deprecate httpd/keystone.py Now that we have keystone-wsgi-admin and keystone-wsgi-public we can deprecate httpd/keystone.py. These 2 are already defined in setup.cfg pointing to wsgi.py to initialize the application. Change-Id: Ifcdfcb31e7be18b511a7c586d9ca259bc15bec44 Closes-Bug: 1494922 --- httpd/keystone.py | 18 +++++++++++++++++- keystone/server/wsgi.py | 4 +++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/httpd/keystone.py b/httpd/keystone.py index 0c7018ff60..05683a91de 100644 --- a/httpd/keystone.py +++ b/httpd/keystone.py @@ -14,12 +14,28 @@ import os +from oslo_log import log +from oslo_log import versionutils + +from keystone.i18n import _LW from keystone.server import wsgi as wsgi_server name = os.path.basename(__file__) +LOG = log.getLogger(__name__) + + +def deprecation_warning(): + versionutils.report_deprecated_feature( + LOG, + _LW('httpd/keystone.py is deprecated as of Mitaka' + ' in favor of keystone-wsgi-admin and keystone-wsgi-public' + ' and may be removed in O.') + ) # NOTE(ldbragst): 'application' is required in this context by WSGI spec. # The following is a reference to Python Paste Deploy documentation # http://pythonpaste.org/deploy/ -application = wsgi_server.initialize_application(name) +application = wsgi_server.initialize_application( + name, + post_log_configured_function=deprecation_warning) diff --git a/keystone/server/wsgi.py b/keystone/server/wsgi.py index ae24c48e33..31948330ad 100644 --- a/keystone/server/wsgi.py +++ b/keystone/server/wsgi.py @@ -47,7 +47,7 @@ KEYSTONE_HEADERS = [ ] -def initialize_application(name): +def initialize_application(name, post_log_configured_function=lambda: None): common.configure() # Log the options used when starting if we're in debug mode... @@ -56,6 +56,8 @@ def initialize_application(name): environment.use_stdlib() + post_log_configured_function() + def loadapp(): return keystone_service.loadapp( 'config:%s' % config.find_paste_config(), name)