Merge "Moved CORS middleware configuration into oslo-config-generator"

This commit is contained in:
Jenkins 2016-03-15 20:51:46 +00:00 committed by Gerrit Code Review
commit f23a0c5c70
9 changed files with 34 additions and 3 deletions

View File

@ -59,9 +59,6 @@ heat.filter_factory = heat.api.openstack:version_negotiation_filter
[filter:cors]
paste.filter_factory = oslo_middleware.cors:filter_factory
oslo_config_project = heat
latent_allow_headers = X-Auth-Token, X-Identity-Status, X-Roles, X-Service-Catalog, X-User-Id, X-Tenant-Id, X-OpenStack-Request-ID
latent_expose_headers = X-Auth-Token, X-Subject-Token, X-Service-Token, X-OpenStack-Request-ID
latent_allow_methods = GET, PUT, POST, DELETE, PATCH
[filter:faultwrap]
paste.filter_factory = heat.common.wsgi:filter_factory

View File

@ -47,6 +47,7 @@ def main():
cfg.CONF(project='heat', prog='heat-api',
version=version.version_info.version_string())
logging.setup(cfg.CONF, 'heat-api')
config.set_config_defaults()
messaging.setup()
app = config.load_paste_app()

View File

@ -51,6 +51,7 @@ def main():
version=version.version_info.version_string())
logging.setup(cfg.CONF, 'heat-api-cfn')
logging.set_defaults()
config.set_config_defaults()
messaging.setup()
app = config.load_paste_app()

View File

@ -51,6 +51,7 @@ def main():
version=version.version_info.version_string())
logging.setup(cfg.CONF, 'heat-api-cloudwatch')
logging.set_defaults()
config.set_config_defaults()
messaging.setup()
app = config.load_paste_app()

View File

@ -17,6 +17,7 @@ import os
from eventlet.green import socket
from oslo_config import cfg
from oslo_log import log as logging
from oslo_middleware import cors
from osprofiler import opts as profiler
from heat.common import exception
@ -464,3 +465,27 @@ def get_client_option(client, option):
# look for the option in the generic [clients] section
cfg.CONF.import_opt(option, 'heat.common.config', group='clients')
return getattr(cfg.CONF.clients, option)
def set_config_defaults():
"""This method updates all configuration default values."""
# 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']
)

View File

@ -38,6 +38,7 @@ def init_application():
version = hversion.version_info.version_string()
cfg.CONF(project='heat', prog='heat-api', version=version)
logging.setup(cfg.CONF, 'heat-api')
config.set_config_defaults()
messaging.setup()
port = cfg.CONF.heat_api.bind_port

View File

@ -40,6 +40,7 @@ def init_application():
version=version.version_info.version_string())
logging.setup(cfg.CONF, 'heat-api-cfn')
logging.set_defaults()
config.set_config_defaults()
messaging.setup()
port = cfg.CONF.heat_api_cfn.bind_port

View File

@ -40,6 +40,7 @@ def init_application():
version=version.version_info.version_string())
logging.setup(cfg.CONF, 'heat-api-cloudwatch')
logging.set_defaults()
config.set_config_defaults()
messaging.setup()
port = cfg.CONF.heat_api_cloudwatch.bind_port

View File

@ -53,6 +53,9 @@ oslo.config.opts =
heat.api.aws.ec2token = heat.api.aws.ec2token:list_opts
heat_integrationtests.common.config = heat_integrationtests.common.config:list_opts
oslo.config.opts.defaults =
heat.common.config = heat.common.config:set_config_defaults
heat.clients =
barbican = heat.engine.clients.os.barbican:BarbicanClientPlugin
ceilometer = heat.engine.clients.os.ceilometer:CeilometerClientPlugin