From 6a28ca245c72b41c3cbe88df68d8d1942f930137 Mon Sep 17 00:00:00 2001 From: "ChangBo Guo(gcb)" Date: Wed, 31 May 2017 14:50:20 +0800 Subject: [PATCH] Remove usage of parameter enforce_type We deprecate and change parameter enforce_type's default value to True[1], and will remove it int the future, so don't need it anymore. [1] https://review.openstack.org/328692 Change-Id: I243444f53e14543c5e4ae4c40d9582fb2d17e155 --- oslo_middleware/base.py | 3 +-- oslo_middleware/healthcheck/pluginbase.py | 3 +-- oslo_middleware/tests/test_http_proxy_to_wsgi.py | 6 ++---- oslo_middleware/tests/test_ssl.py | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/oslo_middleware/base.py b/oslo_middleware/base.py index 27689a1..de98288 100644 --- a/oslo_middleware/base.py +++ b/oslo_middleware/base.py @@ -99,8 +99,7 @@ class ConfigurableMiddleware(object): def _conf_get(self, key, group="oslo_middleware"): if key in self.conf: # Validate value type - self.oslo_conf.set_override(key, self.conf[key], group=group, - enforce_type=True) + self.oslo_conf.set_override(key, self.conf[key], group=group) return getattr(getattr(self.oslo_conf, group), key) @staticmethod diff --git a/oslo_middleware/healthcheck/pluginbase.py b/oslo_middleware/healthcheck/pluginbase.py index eb8013d..5bb8494 100644 --- a/oslo_middleware/healthcheck/pluginbase.py +++ b/oslo_middleware/healthcheck/pluginbase.py @@ -44,6 +44,5 @@ class HealthcheckBaseExtension(object): def _conf_get(self, key, group='healthcheck'): if key in self.conf: # Validate value type - self.oslo_conf.set_override(key, self.conf[key], group=group, - enforce_type=True) + self.oslo_conf.set_override(key, self.conf[key], group=group) return getattr(getattr(self.oslo_conf, group), key) diff --git a/oslo_middleware/tests/test_http_proxy_to_wsgi.py b/oslo_middleware/tests/test_http_proxy_to_wsgi.py index 1554ece..d114ad7 100644 --- a/oslo_middleware/tests/test_http_proxy_to_wsgi.py +++ b/oslo_middleware/tests/test_http_proxy_to_wsgi.py @@ -31,8 +31,7 @@ class TestHTTPProxyToWSGI(test_base.BaseTestCase): self.middleware = http_proxy_to_wsgi.HTTPProxyToWSGI(fake_app) self.middleware.oslo_conf.set_override('enable_proxy_headers_parsing', True, - group='oslo_middleware', - enforce_type=True) + group='oslo_middleware') self.request = webob.Request.blank('/foo/bar', method='POST') def test_backward_compat(self): @@ -139,8 +138,7 @@ class TestHTTPProxyToWSGIDisabled(test_base.BaseTestCase): self.middleware = http_proxy_to_wsgi.HTTPProxyToWSGI(fake_app) self.middleware.oslo_conf.set_override('enable_proxy_headers_parsing', False, - group='oslo_middleware', - enforce_type=True) + group='oslo_middleware') self.request = webob.Request.blank('/foo/bar', method='POST') def test_no_headers(self): diff --git a/oslo_middleware/tests/test_ssl.py b/oslo_middleware/tests/test_ssl.py index e493a3a..810503d 100644 --- a/oslo_middleware/tests/test_ssl.py +++ b/oslo_middleware/tests/test_ssl.py @@ -31,7 +31,7 @@ class SSLMiddlewareTest(base.BaseTestCase): if secure_proxy_ssl_header: middleware.oslo_conf.set_override( 'secure_proxy_ssl_header', secure_proxy_ssl_header, - group='oslo_middleware', enforce_type=True) + group='oslo_middleware') request = webob.Request.blank('http://example.com/', headers=headers) # Ensure ssl middleware does not stop pipeline execution