From ed4bcc0be5fbea67cf0f92ec68eefd80f2933968 Mon Sep 17 00:00:00 2001 From: Tom Barron Date: Mon, 9 May 2016 09:02:33 -0400 Subject: [PATCH] Use oslo_middleware sizelimit In Kilo, cinder.api.middleware.sizelimit was replaced by a compatabilityshim calling in to oslo_middleware.sizelimit and a deprecation log message was added to indicate the change to use oslo_middleware [1]. However, the wsgi api-paste.ini file still uses cinder.api.middleware.sizelimit. This commit modifies api-paste.ini to use oslo_middlware.sizelimit directly, thereby allowing removal of the compatabilty shim in the next release. [1] Ia99ab479cb8ef63a0db1a1208cc2501abba6132c Change-Id: Ic0e2c401b0facdd9abe954b0531d970abf4bca22 --- cinder/api/middleware/sizelimit.py | 4 +++- etc/cinder/api-paste.ini | 2 +- .../use-oslo_middleware_sizelimit-5f171cf1c44444f8.yaml | 9 +++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/use-oslo_middleware_sizelimit-5f171cf1c44444f8.yaml diff --git a/cinder/api/middleware/sizelimit.py b/cinder/api/middleware/sizelimit.py index c110c0648f4..27813655582 100644 --- a/cinder/api/middleware/sizelimit.py +++ b/cinder/api/middleware/sizelimit.py @@ -15,7 +15,9 @@ Request Body limiting middleware. Compatibility shim for Kilo, while operators migrate to oslo.middleware. """ - +# TODO(tbarron): remove this shim in Ocata. Note that although the shim +# was added in Kilo, api-paste.ini was not converted to use oslo.middleware +# until Newton. from oslo_config import cfg from oslo_log import versionutils diff --git a/etc/cinder/api-paste.ini b/etc/cinder/api-paste.ini index 69a7d6b12b9..a761f53d079 100644 --- a/etc/cinder/api-paste.ini +++ b/etc/cinder/api-paste.ini @@ -47,7 +47,7 @@ paste.filter_factory = osprofiler.web:WsgiMiddleware.factory paste.filter_factory = cinder.api.middleware.auth:NoAuthMiddleware.factory [filter:sizelimit] -paste.filter_factory = cinder.api.middleware.sizelimit:RequestBodySizeLimiter.factory +paste.filter_factory = oslo_middleware.sizelimit:RequestBodySizeLimiter.factory [app:apiv1] paste.app_factory = cinder.api.v1.router:APIRouter.factory diff --git a/releasenotes/notes/use-oslo_middleware_sizelimit-5f171cf1c44444f8.yaml b/releasenotes/notes/use-oslo_middleware_sizelimit-5f171cf1c44444f8.yaml new file mode 100644 index 00000000000..e01fd827f53 --- /dev/null +++ b/releasenotes/notes/use-oslo_middleware_sizelimit-5f171cf1c44444f8.yaml @@ -0,0 +1,9 @@ +--- +upgrade: + - use oslo_middleware.sizelimit rather than cinder.api.middleware.sizelimit + compatibility shim +deprecations: + - cinder.api.middleware.sizelimit was deprecated in kilo and compatability + shim added to call into oslo_middleware. Using oslo_middleware.sizelimit + directly will allow us to remove the compatability shim in a future + release.