diff --git a/nova/api/openstack/placement/deploy.py b/nova/api/openstack/placement/deploy.py index fe440cf1f5fb..053e43dd6911 100644 --- a/nova/api/openstack/placement/deploy.py +++ b/nova/api/openstack/placement/deploy.py @@ -32,7 +32,7 @@ NAME = "nova" objects.register_all() -def deploy(conf, project_name): +def deploy(conf): """Assemble the middleware pipeline leading to the placement app.""" if conf.api.auth_strategy == 'noauth2': auth_middleware = auth.NoAuthMiddleware @@ -83,6 +83,20 @@ def deploy(conf, project_name): return application +# NOTE(cdent): Althought project_name is no longer used because of the +# resolution of https://bugs.launchpad.net/nova/+bug/1734491, loadapp() +# is considered a public interface for the creation of a placement +# WSGI app so must maintain its interface. The canonical placement WSGI +# app is created by init_application in wsgi.py, but this is not +# required and in fact can be limiting. loadapp() may be used from +# fixtures or arbitrary WSGI frameworks and loaders. def loadapp(config, project_name=NAME): - application = deploy(config, project_name) + """WSGI application creator for placement. + + :param config: An olso_config.cfg.ConfigOpts containing placement + configuration. + :param project_name: oslo_config project name. Ignored, preserved for + backwards compatibility + """ + application = deploy(config) return application diff --git a/nova/tests/unit/api/openstack/placement/test_deploy.py b/nova/tests/unit/api/openstack/placement/test_deploy.py index 7413d07fcd7e..403df8a7a5df 100644 --- a/nova/tests/unit/api/openstack/placement/test_deploy.py +++ b/nova/tests/unit/api/openstack/placement/test_deploy.py @@ -34,7 +34,7 @@ class DeployTest(test.NoDBTestCase): self.flags(auth_uri=auth_uri, group='keystone_authtoken') # ensure that the auth_token middleware is chosen self.flags(auth_strategy='keystone', group='api') - app = deploy.deploy(CONF, 'nova') + app = deploy.deploy(CONF) req = webob.Request.blank('/resource_providers', method="GET") response = req.get_response(app)