From: Steve Baker Date: Sat, 13 Apr 2013 17:14:11 +0000 (-0700) Subject: Consolidated api-paste.ini file X-Git-Tag: 2014.1~692^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=c0c1768e4a2b441ef286fb49c60419be3fe80786;p=openstack-build%2Fheat-build.git Consolidated api-paste.ini file Load a single api-paste.ini file, specified by config Delete unused paste.ini files Update docs for new paste.ini and config arrangement There will be a corresponding devstack change, and once this is in I will email the packagers on the packaging implications Change-Id: Ic10b1a486094d15bfd832f0f934e6268ec323085 --- diff --git a/doc/source/getting_started/on_fedora.rst b/doc/source/getting_started/on_fedora.rst index d7917632..90d6ddea 100644 --- a/doc/source/getting_started/on_fedora.rst +++ b/doc/source/getting_started/on_fedora.rst @@ -157,9 +157,9 @@ In the heat directory, run the install script:: If running OpenStack grizzly installed via tools/openstack, it is necessary to modify the default service user password:: - sudo sed -i "s/verybadpass/secrete/" /etc/heat/heat-api-cfn-paste.ini - sudo sed -i "s/verybadpass/secrete/" /etc/heat/heat-api-cloudwatch-paste.ini - sudo sed -i "s/verybadpass/secrete/" /etc/heat/heat-api-paste.ini + sudo sed -i "s/verybadpass/secrete/" /etc/heat/heat-api-cfn.conf + sudo sed -i "s/verybadpass/secrete/" /etc/heat/heat-api-cloudwatch.conf + sudo sed -i "s/verybadpass/secrete/" /etc/heat/heat-api.conf Source the keystone credentials created with tools/openstack ------------------------------------------------------------ diff --git a/doc/source/getting_started/on_ubuntu.rst b/doc/source/getting_started/on_ubuntu.rst index a582b0f2..70bdac44 100644 --- a/doc/source/getting_started/on_ubuntu.rst +++ b/doc/source/getting_started/on_ubuntu.rst @@ -101,13 +101,13 @@ Modify configuration for admin password Later a keystone user called '''heat''' will be created. At this point a password for that user needs to be chosen. The following files will need editing: -- /etc/heat/heat-api-cfn-paste.ini -- /etc/heat/heat-api-cloudwatch-paste.ini -- /etc/heat/heat-api-paste.ini +- /etc/heat/heat-api-cfn.conf +- /etc/heat/heat-api-cloudwatch.conf +- /etc/heat/heat-api.conf :: - [filter:authtoken] + [keystone_authtoken] admin_password= diff --git a/doc/source/man/heat-api-cfn.rst b/doc/source/man/heat-api-cfn.rst index 57760a38..9fb7220e 100644 --- a/doc/source/man/heat-api-cfn.rst +++ b/doc/source/man/heat-api-cfn.rst @@ -37,4 +37,3 @@ FILES ======== * /etc/heat/heat-api-cfn.conf -* /etc/heat/heat-api-cfn-paste.ini \ No newline at end of file diff --git a/doc/source/man/heat-api-cloudwatch.rst b/doc/source/man/heat-api-cloudwatch.rst index 488cbebd..192ff251 100644 --- a/doc/source/man/heat-api-cloudwatch.rst +++ b/doc/source/man/heat-api-cloudwatch.rst @@ -31,4 +31,3 @@ FILES ======== * /etc/heat/heat-api-cloudwatch.conf -* /etc/heat/heat-api-cloudwatch-paste.ini \ No newline at end of file diff --git a/doc/source/man/heat-api.rst b/doc/source/man/heat-api.rst index 1bcf86bf..3b382399 100644 --- a/doc/source/man/heat-api.rst +++ b/doc/source/man/heat-api.rst @@ -37,4 +37,3 @@ FILES ======== * /etc/heat/heat-api.conf -* /etc/heat/heat-api-paste.ini \ No newline at end of file diff --git a/docs/GettingStarted.rst b/docs/GettingStarted.rst index 13f67316..e0472e25 100644 --- a/docs/GettingStarted.rst +++ b/docs/GettingStarted.rst @@ -155,9 +155,9 @@ In the heat directory, run the install script:: If running OpenStack grizzly installed via tools/openstack, it is necessary to modify the default service user password:: - sudo sed -i "s/verybadpass/secrete/" /etc/heat/heat-api-cfn-paste.ini - sudo sed -i "s/verybadpass/secrete/" /etc/heat/heat-api-cloudwatch-paste.ini - sudo sed -i "s/verybadpass/secrete/" /etc/heat/heat-api-paste.ini + sudo sed -i "s/verybadpass/secrete/" /etc/heat/heat-api-cfn.conf + sudo sed -i "s/verybadpass/secrete/" /etc/heat/heat-api-cloudwatch.conf + sudo sed -i "s/verybadpass/secrete/" /etc/heat/heat-api.conf Source the keystone credentials created with tools/openstack ------------------------------------------------------------ diff --git a/etc/heat/api-paste.ini b/etc/heat/api-paste.ini new file mode 100644 index 00000000..9ac9f719 --- /dev/null +++ b/etc/heat/api-paste.ini @@ -0,0 +1,56 @@ + +# heat-api pipeline +[pipeline:heat-api] +pipeline = versionnegotiation authtoken context apiv1app + +# heat-api pipeline for custom cloud backends +# i.e. in heat-api.conf: +# [paste_deploy] +# flavor = custombackend +# +[pipeline:heat-api-custombackend] +pipeline = versionnegotiation context custombackendauth apiv1app + +# heat-api-cfn pipeline +[pipeline:heat-api-cfn] +pipeline = cfnversionnegotiation ec2authtoken authtoken context apicfnv1app + +# heat-api-cloudwatch pipeline +[pipeline:heat-api-cloudwatch] +pipeline = versionnegotiation ec2authtoken authtoken context apicwapp + +[app:apiv1app] +paste.app_factory = heat.common.wsgi:app_factory +heat.app_factory = heat.api.openstack.v1:API + +[app:apicfnv1app] +paste.app_factory = heat.common.wsgi:app_factory +heat.app_factory = heat.api.cfn.v1:API + +[app:apicwapp] +paste.app_factory = heat.common.wsgi:app_factory +heat.app_factory = heat.api.cloudwatch:API + +[filter:versionnegotiation] +paste.filter_factory = heat.common.wsgi:filter_factory +heat.filter_factory = heat.api.openstack:version_negotiation_filter + +[filter:cfnversionnegotiation] +paste.filter_factory = heat.common.wsgi:filter_factory +heat.filter_factory = heat.api.cfn:version_negotiation_filter + +[filter:cwversionnegotiation] +paste.filter_factory = heat.common.wsgi:filter_factory +heat.filter_factory = heat.api.cloudwatch:version_negotiation_filter + +[filter:context] +paste.filter_factory = heat.common.context:ContextMiddleware_filter_factory + +[filter:ec2authtoken] +paste.filter_factory = heat.api.aws.ec2token:EC2Token_filter_factory + +[filter:authtoken] +paste.filter_factory = heat.common.auth_token:filter_factory + +[filter:custombackendauth] +paste.filter_factory = heat.common.custom_backend_auth:filter_factory \ No newline at end of file diff --git a/etc/heat/heat-api-cfn-paste.ini b/etc/heat/heat-api-cfn-paste.ini deleted file mode 100644 index 3f496eed..00000000 --- a/etc/heat/heat-api-cfn-paste.ini +++ /dev/null @@ -1,29 +0,0 @@ - -# Default pipeline -[pipeline:heat-api-cfn] -pipeline = versionnegotiation ec2authtoken authtoken context apicfnv1app - -# Use the following pipeline for keystone auth -# i.e. in heat-api-cfn.conf: -# [paste_deploy] -# flavor = keystone -# -[pipeline:heat-api-cfn-keystone] -pipeline = versionnegotiation ec2authtoken authtoken context apicfnv1app - -[app:apicfnv1app] -paste.app_factory = heat.common.wsgi:app_factory -heat.app_factory = heat.api.cfn.v1:API - -[filter:versionnegotiation] -paste.filter_factory = heat.common.wsgi:filter_factory -heat.filter_factory = heat.api.cfn:version_negotiation_filter - -[filter:context] -paste.filter_factory = heat.common.context:ContextMiddleware_filter_factory - -[filter:ec2authtoken] -paste.filter_factory = heat.api.aws.ec2token:EC2Token_filter_factory - -[filter:authtoken] -paste.filter_factory = heat.common.auth_token:filter_factory diff --git a/etc/heat/heat-api-cloudwatch-paste.ini b/etc/heat/heat-api-cloudwatch-paste.ini deleted file mode 100644 index b71d7ed9..00000000 --- a/etc/heat/heat-api-cloudwatch-paste.ini +++ /dev/null @@ -1,29 +0,0 @@ - -# Default pipeline -[pipeline:heat-api-cloudwatch] -pipeline = versionnegotiation ec2authtoken authtoken context apicwapp - -# Use the following pipeline for keystone auth -# i.e. in heat-api-cloudwatch.conf: -# [paste_deploy] -# flavor = keystone -# -[pipeline:heat-api-cloudwatch-keystone] -pipeline = versionnegotiation ec2authtoken authtoken context apicwapp - -[app:apicwapp] -paste.app_factory = heat.common.wsgi:app_factory -heat.app_factory = heat.api.cloudwatch:API - -[filter:versionnegotiation] -paste.filter_factory = heat.common.wsgi:filter_factory -heat.filter_factory = heat.api.cloudwatch:version_negotiation_filter - -[filter:context] -paste.filter_factory = heat.common.context:ContextMiddleware_filter_factory - -[filter:ec2authtoken] -paste.filter_factory = heat.api.aws.ec2token:EC2Token_filter_factory - -[filter:authtoken] -paste.filter_factory = heat.common.auth_token:filter_factory diff --git a/etc/heat/heat-api-paste.ini b/etc/heat/heat-api-paste.ini deleted file mode 100644 index ebe584c7..00000000 --- a/etc/heat/heat-api-paste.ini +++ /dev/null @@ -1,37 +0,0 @@ - -# Default pipeline -[pipeline:heat-api] -pipeline = versionnegotiation authtoken context apiv1app - -# Use the following pipeline for keystone auth -# i.e. in heat-api.conf: -# [paste_deploy] -# flavor = keystone -# -[pipeline:heat-api-keystone] -pipeline = versionnegotiation authtoken context apiv1app - -# Use the following pipeline for custom cloud backends -# i.e. in heat-api.conf: -# [paste_deploy] -# flavor = custombackend -# -[pipeline:heat-api-custombackend] -pipeline = versionnegotiation context custombackendauth apiv1app - -[app:apiv1app] -paste.app_factory = heat.common.wsgi:app_factory -heat.app_factory = heat.api.openstack.v1:API - -[filter:versionnegotiation] -paste.filter_factory = heat.common.wsgi:filter_factory -heat.filter_factory = heat.api.openstack:version_negotiation_filter - -[filter:context] -paste.filter_factory = heat.common.context:ContextMiddleware_filter_factory - -[filter:authtoken] -paste.filter_factory = heat.common.auth_token:filter_factory - -[filter:custombackendauth] -paste.filter_factory = heat.common.custom_backend_auth:filter_factory diff --git a/heat/common/config.py b/heat/common/config.py index 9d631d9b..02df22cf 100644 --- a/heat/common/config.py +++ b/heat/common/config.py @@ -34,7 +34,8 @@ DEFAULT_PORT = 8000 paste_deploy_group = cfg.OptGroup('paste_deploy') paste_deploy_opts = [ cfg.StrOpt('flavor'), - cfg.StrOpt('config_file')] + cfg.StrOpt('api_paste_config', default="api-paste.ini", + help="The API paste config file to use")] bind_opts = [ @@ -157,17 +158,10 @@ def _get_deployment_config_file(): absolute pathname. """ _register_paste_deploy_opts() - config_file = cfg.CONF.paste_deploy.config_file - if not config_file: - if cfg.CONF.config_file: - # Assume paste config is in a paste.ini file corresponding - # to the last config file - path = os.path.splitext(cfg.CONF.config_file[-1])[0] + "-paste.ini" - else: - return None - else: - path = config_file - return os.path.abspath(path) + config_path = os.path.abspath(cfg.CONF.find_file( + cfg.CONF.paste_deploy['api_paste_config'])) + + return os.path.abspath(config_path) def load_paste_app(app_name=None):