summaryrefslogtreecommitdiff
path: root/heatclient/v1
diff options
context:
space:
mode:
authorrabi <ramishra@redhat.com>2016-05-17 12:57:15 +0530
committerrabi <ramishra@redhat.com>2016-05-17 14:55:55 +0530
commit01b7781f68e8b7a158ad874814f2a16d21f48505 (patch)
tree5ccf5cdf7d9dc4dbb633e7a95ffdd4fc3df4efb5 /heatclient/v1
parent7db039b75dfbaf40ef0fc65763ebdee92f2060f2 (diff)
downloadpython-heatclient-01b7781f68e8b7a158ad874814f2a16d21f48505.tar.gz
Allow redirects to use location from response
This allows redirects to use fully qualified location from response header and removes the check to prohibit redirects to different project(required for super admin actions). Change-Id: I46876189e96375922c4f0bf30452b7c4980fe39c
Diffstat (limited to 'heatclient/v1')
-rw-r--r--heatclient/v1/stacks.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/heatclient/v1/stacks.py b/heatclient/v1/stacks.py
index b641b50..7279ea5 100644
--- a/heatclient/v1/stacks.py
+++ b/heatclient/v1/stacks.py
@@ -17,6 +17,8 @@ from heatclient.common import utils
import six
from six.moves.urllib import parse
+from heatclient import exc
+from heatclient.openstack.common._i18n import _
from heatclient.openstack.common.apiclient import base
@@ -106,8 +108,10 @@ class StackChildManager(base.BaseManager):
# redirected stacks:show, so pass redirect=False
resp = self.client.get('/stacks/%s' % stack_id, redirect=False)
location = resp.headers.get('location')
- path = self.client.strip_endpoint(location)
- return path[len('/stacks/'):]
+ if not location:
+ message = _("Location not returned with redirect")
+ raise exc.InvalidEndpoint(message=message)
+ return location.split('/stacks/', 1)[1]
class StackManager(StackChildManager):