python-heatclient does not work on windows

Bug #1254657 reported by chenhaiq
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-heatclient
Fix Released
High
chenhaiq

Bug Description

This is reported from:
https://ask.openstack.org/en/question/7464/python-heatclient-does-not-work-on-windows/?sort=latest

Error:
On Windows platform, all heat client cmd failed with HTTPMultipleChoices (HTTP 300) Requested version of Heat API is notavailable.

Root cause:
os.path.normpath is used to clean url. On windows platform, it return url with "\" instead of "/", which is required in heat api in:
/heat/heat/api/middleware/version_negotiation.py, path_info_peek method.

Revision history for this message
chenhaiq (chenhaiq) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/#/c/58243/

affects: heat → python-heatclient
Changed in python-heatclient:
assignee: nobody → chenhaiq (chenhaiq)
Changed in python-heatclient:
status: New → In Progress
Revision history for this message
Alessandro Pilotti (alexpilotti) wrote :

os.path.normpath() should not be used to normalize URLs as on Windows it replaces / with \.

The "posixpath" module is what is used as "os.path" implementation on Posix systems and can be safely used to normalize paths on any platform.

We found this issue various times, here's an example of the solution described above:

https://review.openstack.org/#/c/15763/4/nova/api/metadata/base.py

Thanks

Steven Hardy (shardy)
Changed in python-heatclient:
status: In Progress → Triaged
importance: Undecided → High
milestone: none → v0.2.6
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-heatclient (master)

Reviewed: https://review.openstack.org/58243
Committed: http://github.com/openstack/python-heatclient/commit/0707e337d00bf32605ee5ee7f0e1ceb8bcece84d
Submitter: Jenkins
Branch: master

commit 0707e337d00bf32605ee5ee7f0e1ceb8bcece84d
Author: chenhaiq <email address hidden>
Date: Mon Nov 25 18:12:06 2013 +0800

    use correct url on Windows platform

    os.path.normpath is used to clean url. On windows platform, it
    returns url with "\" instead of "/", which is required in heat api
     in:
    /heat/heat/api/middleware/version_negotiation.py,
    path_info_peek method.

    Change-Id: Ic1a5fc5dd789a7996e08a85a9d8908267e203565
    Closes-Bug: 1254657

Changed in python-heatclient:
status: Triaged → Fix Committed
Changed in python-heatclient:
status: Fix Committed → Fix Released
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.