Fetching an template object prepends the heat url when using --os-no-client-auth

Bug #1408518 reported by Jamie Lennox
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-heatclient
Triaged
Low
Unassigned

Bug Description

Related to bug 1408199

When using the CLI with --os-no-client-auth it uses the older HTTPClient object rather than the newer SessionClient as (I assume) it better supports handling authenticating directly to heat.

When you make a request using the heatclient HTTPClient object it will always prepend the heat url. This is useful from within the client as it means you make a request using only the path that you want to request.

However in the case of fetching a template from swift we reuse this mechanism to make a request that includes a token. This has the downside though that even though you pass a full url to this object the client will still prepend the heat url and you will end up with an invalid url to fetch from.

When not using --os-no-client-auth it goes via the SessionClient which handles this correctly.

heat -d --os-no-client-auth --heat-url http://10.16.18.220:8004/v1/3ecb536d46674df191f6558d2204d8a8 --os-auth-token c72f95675274402cbf47c4957d091f39 stack-create -o https://github.com/openstack/python-heatclient/blob/master/heatclient/tests/var/minimal.template test2

DEBUG (http) curl -g -i -X GET -H 'X-Auth-Token: {SHA1}fb48d3e2c75f316c291959e10c4b521d9ce9db61' -H 'Content-Type: application/octet-stream' -H 'User-Agent: python-heatclient' http://10.16.18.220:8004/v1/3ecb536d46674df191f6558d2204d8a8https://github.com/openstack/python-heatclient/blob/master/heatclient/tests/var/minimal.template
INFO (connectionpool) Starting new HTTP connection (1): 10.16.18.220
DEBUG (connectionpool) "GET /v1/3ecb536d46674df191f6558d2204d8a8https://github.com/openstack/python-heatclient/blob/master/heatclient/tests/var/minimal.template HTTP/1.1" 404 154

Revision history for this message
Angus Salkeld (asalkeld) wrote :

I assume this is only when you are using "-o", as I use --os-no-client-auth all the time with no problem.

Changed in python-heatclient:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Jamie Lennox (jamielennox) wrote :

yes, it's related to using -o. Using --os-no-client-auth makes the CLI run through the older HTTPClient code paths that don't handle this. It works fine normally.

Neetu Jain (nutshi)
summary: - Fetching an template object prepends the heat url when using --os-no-
- client-auth
+ Fetching an template object prepends the heat url when using "-o",
+ instead of --os-no-client-auth
summary: - Fetching an template object prepends the heat url when using "-o",
- instead of --os-no-client-auth
+ Fetching an template object prepends the heat url when using --os-no-
+ client-auth
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.