Pecan assuming meter names are extensions

Bug #1224132 reported by gordon chung
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
High
gordon chung

Bug Description

Pecan has a 'feature' which guess content-type from the url 'extension'. this causes issues in py26 and may cause issues in other version. the following error occurs in when getting http.request samples

==================================================================
GET http://localhost:8777/v2/meters/http.request HTTP/1.1

> X-Auth-Token: 78e25b535bd3442c9964367966bba599
> Content-Type: application/json
> Accept: application/json
> User-Agent: powervc-httpclient

< HTTP/1.1 404 Not Found
< Content-Type: application/json
< Content-Length: 77

{
 "error_message": "404 Not Found\n\nThe resource could not be found.\n\n "
}
==================================================================

in Pecan, when it tries to route the url path, there is logic which tries to figure out the content type based on the 'extension' of the url (it assumes '.request' is the extension). specifically at one point, it will attempt to guess the content_type based on this 'extension': https://github.com/stackforge/pecan/blob/master/pecan/core.py#L413 . in python2.7, it will not successfully guess what extension '.request'. however, in python2.6, it will guess a match -- it will guess content-type is application/vnd.nervana -- and it strips out '.request' from the path and it all goes downhill from there.

gordon chung (chungg)
Changed in ceilometer:
assignee: nobody → gordon chung (chungg)
gordon chung (chungg)
summary: - Pecan guessing extensions from meter names
+ Pecan assuming meter names are extensions
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/46143

Changed in ceilometer:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/46143
Committed: http://github.com/openstack/ceilometer/commit/f9fbaf2fdd4fbdd38b339d7b067d4446d93e85d7
Submitter: Jenkins
Branch: master

commit f9fbaf2fdd4fbdd38b339d7b067d4446d93e85d7
Author: Gordon Chung <email address hidden>
Date: Wed Sep 11 17:47:21 2013 -0400

    Pecan assuming meter names are extensions

    disable Pecan guessing content_type based on url path

    Change-Id: I23862af3a9ae41980a8c3f33bf569acf9ff77a08
    Fixes: Bug #1224132

Changed in ceilometer:
status: In Progress → Fix Committed
Julien Danjou (jdanjou)
Changed in ceilometer:
importance: Undecided → High
milestone: none → havana-rc1
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: havana-rc1 → 2013.2
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.