All other API actions will provide a redirect if you only provide the
stack ID or name (rather than both), the template URL currently doesn't
because the template subpath is missing from the mapper lookup
Fixes bug #
1178705
Change-Id: Ib8e8dd7691bc48587c9d91e937ac2c2c35ac3ce6
stack_mapper.connect("stack_lookup",
r"/stacks/{stack_name:arn\x3A.*}",
action="lookup")
- subpaths = ['resources', 'events']
+ subpaths = ['resources', 'events', 'template']
path = "{path:%s}" % '|'.join(subpaths)
stack_mapper.connect("stack_lookup_subpath",
"/stacks/{stack_name}/" + path,
'stack_name': 'teststack',
'stack_id': 'bbbb',
})
+
+ def test_stack_data_template(self):
self.assertRoute(
self.m,
'/aaaa/stacks/teststack/bbbb/template',
'stack_name': 'teststack',
'stack_id': 'bbbb',
})
+ self.assertRoute(
+ self.m,
+ '/aaaa/stacks/teststack/template',
+ 'GET',
+ 'lookup',
+ 'StackController',
+ {
+ 'tenant_id': 'aaaa',
+ 'stack_name': 'teststack',
+ 'path': 'template'
+ })
def test_stack_update_delete(self):
self.assertRoute(