]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
ReST API: Fix template validation
authorZane Bitter <zbitter@redhat.com>
Wed, 10 Oct 2012 13:38:04 +0000 (15:38 +0200)
committerZane Bitter <zbitter@redhat.com>
Wed, 10 Oct 2012 13:45:39 +0000 (15:45 +0200)
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 <zbitter@redhat.com>
heat/api/openstack/v1/__init__.py
heat/api/openstack/v1/stacks.py

index 9b793d5e7393f063a225e82407b1ec3ffe4c646a..b5011706564e479bd0a868fb823475dd17afeb7b 100644 (file)
@@ -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)
index 1e529dcb109b6bf59476e6e76df2bd492a188430..acd7ade6d77f05a84c804c18f0d4a8e991951ef8 100644 (file)
@@ -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)