Remove the legacy v2 API entry from api-paste.ini

The api sample tests and functional tests already stopped to
run against with legacy v2 API. This patch removes the legacy
V2 API entry from api-paste.ini, it stops user from using
legacy V2 API. This patch also adds deprecated report in pipeline
factory method to notice the user update their api-paste.ini
after upgrade code.

Partially implements blueprint remove-legacy-v2-api-code

Change-Id: I1476b2e364032d7c98f71df0cd61f1d1c19e005d
This commit is contained in:
He Jie Xu
2016-05-04 10:33:21 +08:00
parent e22983576b
commit 5a64f57824
4 changed files with 25 additions and 54 deletions

View File

@@ -18,6 +18,7 @@ Common Auth Middleware.
from oslo_config import cfg
from oslo_log import log as logging
from oslo_log import versionutils
from oslo_middleware import request_id
from oslo_serialization import jsonutils
import webob.dec
@@ -25,6 +26,7 @@ import webob.exc
from nova import context
from nova.i18n import _
from nova.i18n import _LW
from nova import wsgi
@@ -65,13 +67,12 @@ def _load_pipeline(loader, pipeline):
def pipeline_factory(loader, global_conf, **local_conf):
"""A paste pipeline replica that keys off of auth_strategy."""
pipeline = local_conf[CONF.auth_strategy]
if not CONF.api_rate_limit:
limit_name = CONF.auth_strategy + '_nolimit'
pipeline = local_conf.get(limit_name, pipeline)
pipeline = pipeline.split()
return _load_pipeline(loader, pipeline)
versionutils.report_deprecated_feature(
LOG,
_LW("The legacy V2 API code tree has been removed in Newton. "
"Please remove legacy v2 API entry from api-paste.ini, and use "
"V2.1 API or V2.1 API compat mode instead")
)
def pipeline_factory_v21(loader, global_conf, **local_conf):