query_to_kwargs inconsistent behaviour on invalid input

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

Bug Description

relating patch to add testcases for _query_to_kwargs() function, invalid operators and fields will give different results

if you have an invalid field but valid operator ('eq'), an UnknownArgument is raised
if you have an invalid operator but valid field, a warning is logged but query continues to be processed
if you have invalid field and invalid operator, invalid operator takes precedence, warning logged, and query continues.

i don't think invalid operator should hide the invalid field error. we should probably be raising for invalid operator and invalid field.

thoughts?

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/43796

Changed in ceilometer:
assignee: nobody → gordon chung (chungg)
status: New → In Progress
Changed in ceilometer:
assignee: gordon chung (chungg) → Tong Li (litong01)
Changed in ceilometer:
assignee: Tong Li (litong01) → gordon chung (chungg)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/43796
Committed: http://github.com/openstack/ceilometer/commit/05db82ac1b7ca8b32228844eddaf8f23faae2ab0
Submitter: Jenkins
Branch: master

commit 05db82ac1b7ca8b32228844eddaf8f23faae2ab0
Author: Gordon Chung <email address hidden>
Date: Mon Aug 26 18:40:36 2013 -0400

    add tests for _query_to_kwargs func

    add test case for _query_to_kwargs function in v2 api.
    raise InvalidInput on invalid operator

    Change-Id: Ia9e9b3905327d21e3c6f91aa0acd36f19f4f59b0
    Partial-Bug: #1217129

gordon chung (chungg)
Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → havana-rc1
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.