Use cors.set_defaults instead of cfg.set_defaults

Cors has been added setdefaults method, just use it.
Related link:
https://review.openstack.org/#/c/285368/

Change-Id: I26e1ecdf4a92ab55eeb794a0df7ba6a323f9141a
This commit is contained in:
Li Wei 2016-11-04 11:09:53 +08:00
parent 44ce1d4d29
commit ed59f6bd1a

View File

@ -188,27 +188,25 @@ def verify_share_protocols():
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-Openstack-Manila-Api-Version',
'X-OpenStack-Manila-API-Experimental',
'X-Identity-Status',
'X-Roles',
'X-Service-Catalog',
'X-User-Id',
'X-Tenant-Id'],
expose_headers=['X-Auth-Token',
'X-OpenStack-Request-ID',
'X-Openstack-Manila-Api-Version',
'X-OpenStack-Manila-API-Experimental',
'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-Openstack-Manila-Api-Version',
'X-OpenStack-Manila-API-Experimental',
'X-Identity-Status',
'X-Roles',
'X-Service-Catalog',
'X-User-Id',
'X-Tenant-Id'],
expose_headers=['X-Auth-Token',
'X-OpenStack-Request-ID',
'X-Openstack-Manila-Api-Version',
'X-OpenStack-Manila-API-Experimental',
'X-Subject-Token',
'X-Service-Token'],
allow_methods=['GET',
'PUT',
'POST',
'DELETE',
'PATCH']
)