From 454b2dffb6b988ca6381c9ef1a973be654921b2b Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Wed, 10 Oct 2012 15:38:04 +0200 Subject: [PATCH] ReST API: Fix template validation Also move the URL to be local to a tenant. This is because keystone will automatically fill in the tenant id in the endpoint, so all requests will use this as a base URL. Change-Id: I3fbd5a7d256426079824f8a26fdcd41eac083146 Signed-off-by: Zane Bitter --- heat/api/openstack/v1/__init__.py | 4 ++-- heat/api/openstack/v1/stacks.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/heat/api/openstack/v1/__init__.py b/heat/api/openstack/v1/__init__.py index 9b793d5e..b5011706 100644 --- a/heat/api/openstack/v1/__init__.py +++ b/heat/api/openstack/v1/__init__.py @@ -74,8 +74,8 @@ class API(wsgi.Router): conditions={'method': 'DELETE'}) # Template handling - mapper.connect("stack", "/validate", - controller=stacks_resource, action="validate", + mapper.connect("stack", "/{tenant_id}/validate", + controller=stacks_resource, action="validate_template", conditions={'method': 'POST'}) super(API, self).__init__(mapper) diff --git a/heat/api/openstack/v1/stacks.py b/heat/api/openstack/v1/stacks.py index 1e529dcb..acd7ade6 100644 --- a/heat/api/openstack/v1/stacks.py +++ b/heat/api/openstack/v1/stacks.py @@ -323,6 +323,7 @@ class StackController(object): raise exc.HTTPNoContent() + @tenant_local def validate_template(self, req): """ Implements the ValidateTemplate API action @@ -334,7 +335,7 @@ class StackController(object): try: return self.engine_rpcapi.validate_template(req.context, - template, params) + template, stack_params) except rpc_common.RemoteError as ex: return self._remote_error(ex) -- 2.45.2