From 79b4bf392773079a6dd0a7b0a43f4c69f1cd5a45 Mon Sep 17 00:00:00 2001 From: zhangshengping2012 Date: Wed, 26 Oct 2016 16:45:00 +0800 Subject: [PATCH] Use set_defaults method in oslo_middleware to check CORS_OPTS replace the cfg.set_defaults with cors.set_defaults for check the CORS_OPTS Change-Id: I3faa92574a755e6cc410c69e0e673abad93e6315 --- ceilometer/conf/defaults.py | 39 +++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/ceilometer/conf/defaults.py b/ceilometer/conf/defaults.py index d6b0ff5c81..e87b153025 100644 --- a/ceilometer/conf/defaults.py +++ b/ceilometer/conf/defaults.py @@ -12,29 +12,26 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg from oslo_middleware import cors def set_cors_middleware_defaults(): """Update default configuration options for oslo.middleware.""" - # CORS Defaults - # TODO(krotscheck): Update with https://review.openstack.org/#/c/285368/ - cfg.set_defaults(cors.CORS_OPTS, - allow_headers=['X-Auth-Token', - 'X-Identity-Status', - 'X-Roles', - 'X-Service-Catalog', - 'X-User-Id', - 'X-Tenant-Id', - 'X-Openstack-Request-Id'], - expose_headers=['X-Auth-Token', - 'X-Subject-Token', - 'X-Service-Token', - 'X-Openstack-Request-Id'], - allow_methods=['GET', - 'PUT', - 'POST', - 'DELETE', - 'PATCH'] - ) + cors.set_defaults( + allow_headers=['X-Auth-Token', + 'X-Identity-Status', + 'X-Roles', + 'X-Service-Catalog', + 'X-User-Id', + 'X-Tenant-Id', + 'X-Openstack-Request-Id'], + expose_headers=['X-Auth-Token', + 'X-Subject-Token', + 'X-Service-Token', + 'X-Openstack-Request-Id'], + allow_methods=['GET', + 'PUT', + 'POST', + 'DELETE', + 'PATCH'] + )