'Redirect to the canonical URL for a stack.'

@util.policy_enforce
def lookup(self, req, stack_name, path='', body=None):

    try:
        identity = dict(identifier.HeatIdentifier.from_arn(stack_name))
    except ValueError:
        identity = self.rpc_client.identify_stack(req.context, stack_name)
    location = util.make_url(req, identity)
    if path:
        location = '/'.join([location, path])
    params = req.params
    if params:
        location += ('?%s' % parse.urlencode(params, True))
    raise exc.HTTPFound(location=location)
