diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-03-20 21:09:51 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-03-20 21:09:51 +0000 |
commit | bb2aa6a40d832c30b8c92964af57f711f0a37eb9 (patch) | |
tree | c4f89480d2ea3e6dae3239f0563756a4682cc619 /heatclient/v1/stacks.py | |
parent | 0a38eb94cd7f5ec01d7ea8b72019a6ea9348c136 (diff) | |
parent | 8fe87b422dc0886d5aba6a56dfd125b33a9c74c4 (diff) | |
download | python-heatclient-bb2aa6a40d832c30b8c92964af57f711f0a37eb9.tar.gz |
Merge "Modify stack ID lookup to only use stacks:lookup"
Diffstat (limited to 'heatclient/v1/stacks.py')
-rw-r--r-- | heatclient/v1/stacks.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/heatclient/v1/stacks.py b/heatclient/v1/stacks.py index 34d0c31..eb959f6 100644 --- a/heatclient/v1/stacks.py +++ b/heatclient/v1/stacks.py @@ -171,7 +171,13 @@ class StackChildManager(base.BaseManager): # then it is already {stack_name}/{stack_id} if stack_id.find('/') > 0: return stack_id + # We want to capture the redirect, not actually get the stack, + # since all we want is the stacks:lookup response to get the + # fully qualified ID, and not all users are allowed to do the + # redirected stacks:show, so pass follow_redirects=False resp, body = self.client.json_request('GET', - '/stacks/%s' % stack_id) - stack = body['stack'] - return '%s/%s' % (stack['stack_name'], stack['id']) + '/stacks/%s' % stack_id, + follow_redirects=False) + location = resp.headers.get('location') + path = self.client.strip_endpoint(location) + return path[len('/stacks/'):] |