From c0c1768e4a2b441ef286fb49c60419be3fe80786 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Sat, 13 Apr 2013 10:14:11 -0700 Subject: [PATCH] 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 --- doc/source/getting_started/on_fedora.rst | 6 +-- doc/source/getting_started/on_ubuntu.rst | 8 ++-- doc/source/man/heat-api-cfn.rst | 1 - doc/source/man/heat-api-cloudwatch.rst | 1 - doc/source/man/heat-api.rst | 1 - docs/GettingStarted.rst | 6 +-- etc/heat/api-paste.ini | 56 ++++++++++++++++++++++++ etc/heat/heat-api-cfn-paste.ini | 29 ------------ etc/heat/heat-api-cloudwatch-paste.ini | 29 ------------ etc/heat/heat-api-paste.ini | 37 ---------------- heat/common/config.py | 18 +++----- 11 files changed, 72 insertions(+), 120 deletions(-) create mode 100644 etc/heat/api-paste.ini delete mode 100644 etc/heat/heat-api-cfn-paste.ini delete mode 100644 etc/heat/heat-api-cloudwatch-paste.ini delete mode 100644 etc/heat/heat-api-paste.ini diff --git a/doc/source/getting_started/on_fedora.rst b/doc/source/getting_started/on_fedora.rst index d7917632f..90d6ddea8 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 a582b0f2d..70bdac44a 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 57760a383..9fb7220e7 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 488cbebd9..192ff2517 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 1bcf86bf9..3b3823992 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 13f673163..e0472e25f 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 000000000..9ac9f7196 --- /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 3f496eeda..000000000 --- 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 b71d7ed9f..000000000 --- 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 ebe584c72..000000000 --- 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 9d631d9ba..02df22cf1 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):