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(): def set_middleware_defaults():
"""Update default configuration options for oslo.middleware.""" """Update default configuration options for oslo.middleware."""
# CORS Defaults cors.set_defaults(
# TODO(krotscheck): Update with https://review.openstack.org/#/c/285368/ allow_headers=['X-Auth-Token',
cfg.set_defaults(cors.CORS_OPTS, 'X-OpenStack-Request-ID',
allow_headers=['X-Auth-Token', 'X-Openstack-Manila-Api-Version',
'X-OpenStack-Request-ID', 'X-OpenStack-Manila-API-Experimental',
'X-Openstack-Manila-Api-Version', 'X-Identity-Status',
'X-OpenStack-Manila-API-Experimental', 'X-Roles',
'X-Identity-Status', 'X-Service-Catalog',
'X-Roles', 'X-User-Id',
'X-Service-Catalog', 'X-Tenant-Id'],
'X-User-Id', expose_headers=['X-Auth-Token',
'X-Tenant-Id'], 'X-OpenStack-Request-ID',
expose_headers=['X-Auth-Token', 'X-Openstack-Manila-Api-Version',
'X-OpenStack-Request-ID', 'X-OpenStack-Manila-API-Experimental',
'X-Openstack-Manila-Api-Version', 'X-Subject-Token',
'X-OpenStack-Manila-API-Experimental', 'X-Service-Token'],
'X-Subject-Token', allow_methods=['GET',
'X-Service-Token'], 'PUT',
allow_methods=['GET', 'POST',
'PUT', 'DELETE',
'POST', 'PATCH']
'DELETE', )
'PATCH']
)