From 086b7a7de994e30d2e5defa214eca846862aec59 Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Sat, 5 Nov 2016 20:16:38 -0400 Subject: [PATCH] cors: update default configuration in config Set_defautls has been added into oslo.middleware, so we use it to overrive the configuration defaults. Change-Id: I9696ad8210a0ee4fee6c0f78be777a5939b221a4 Signed-off-by: Chuck Short --- nova/common/config.py | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/nova/common/config.py b/nova/common/config.py index 4f4557d0299e..5dd60ea7f7b3 100644 --- a/nova/common/config.py +++ b/nova/common/config.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_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-Openstack-Request-Id', - 'X-Identity-Status', - 'X-Roles', - 'X-Service-Catalog', - 'X-User-Id', - 'X-Tenant-Id'], - expose_headers=['X-Auth-Token', - 'X-Openstack-Request-Id', - 'X-Subject-Token', - 'X-Service-Token'], - allow_methods=['GET', - 'PUT', - 'POST', - 'DELETE', - 'PATCH'] - ) + cors.set_defaults( + allow_headers=['X-Auth-Token', + 'X-Openstack-Request-Id', + 'X-Identity-Status', + 'X-Roles', + 'X-Service-Catalog', + 'X-User-Id', + 'X-Tenant-Id'], + expose_headers=['X-Auth-Token', + 'X-Openstack-Request-Id', + 'X-Subject-Token', + 'X-Service-Token'], + allow_methods=['GET', + 'PUT', + 'POST', + 'DELETE', + 'PATCH'] + )