[placement] Use own set_middleware_defaults
The CORS middleware needs to have its defaults set to something reaonable. Placement had been using some code in nova to do so. This change duplicates that code into the placement WSGI app which had been calling it. Change-Id: I025a2d14c4126f68e199efa54329797576c50677 blueprint: placement-extract
This commit is contained in:
parent
7f2f183824
commit
7bb4bd6f29
@ -19,12 +19,12 @@ import os
|
||||
import os.path
|
||||
|
||||
from oslo_log import log as logging
|
||||
from oslo_middleware import cors
|
||||
from oslo_utils import importutils
|
||||
import pbr.version
|
||||
|
||||
from nova.api.openstack.placement import db_api
|
||||
from nova.api.openstack.placement import deploy
|
||||
from nova.common import config
|
||||
from nova import conf
|
||||
|
||||
|
||||
@ -63,12 +63,34 @@ def _parse_args(argv, default_config_files):
|
||||
if profiler:
|
||||
profiler.set_defaults(conf.CONF)
|
||||
|
||||
config.set_middleware_defaults()
|
||||
_set_middleware_defaults()
|
||||
|
||||
conf.CONF(argv[1:], project='nova', version=version_info.version_string(),
|
||||
default_config_files=default_config_files)
|
||||
|
||||
|
||||
def _set_middleware_defaults():
|
||||
"""Update default configuration options for oslo.middleware."""
|
||||
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']
|
||||
)
|
||||
|
||||
|
||||
def init_application():
|
||||
# initialize the config system
|
||||
conffile = _get_config_file()
|
||||
|
Loading…
x
Reference in New Issue
Block a user