The API returns an invalid error message, if an unknown field name is specified in the params of the simple query

Bug #1294628 reported by Ildiko Vancsa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Medium
Ildiko Vancsa
Havana
Fix Released
Medium
Ildiko Vancsa

Bug Description

If the following simple query is sent to the API:
q=[{'field': 'non_valid_key',
    'op': 'lt',
    'value': 42}]

the following error message is received:
u"Invalid input for field/attribute op. Value: 'lt'. unimplemented operator for non_valid_key"

instead of:
u'Unknown argument: "non_valid_key": unrecognized field in query: [<Query u\'non_valid_key\' lt u\'42\' None>], valid keys: set([\'resource\', \'end\', \'start\', \'metaquery\', \'end_timestamp_op\', \'meter\', \'project\', \'source\', \'user\', \'start_timestamp_op\', \'message_id\'])'

Changed in ceilometer:
importance: Undecided → Medium
assignee: nobody → Ildiko Vancsa (ildiko-vancsa)
milestone: none → icehouse-rc1
description: updated
Eoghan Glynn (eglynn)
summary: - The APi returns an invalid error message, if an unknown field name is
+ The API returns an invalid error message, if an unknown field name is
specified in the params of the simple query
Julien Danjou (jdanjou)
Changed in ceilometer:
status: New → Triaged
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/82110

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

Reviewed: https://review.openstack.org/82110
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=50cffbc08f24ff8e3935aabecdf4be0fb366116d
Submitter: Jenkins
Branch: master

commit 50cffbc08f24ff8e3935aabecdf4be0fb366116d
Author: Ildiko Vancsa <email address hidden>
Date: Wed Mar 19 15:31:31 2014 +0100

    Fix validation error for invalid field name in simple query

    The field name validation code runs only in case of the operator that is
    specified for the invalid field name, is 'eq'. Otherwise the validation
    ends with an invalid operator error. The field name validation code was
    modified to check the field name first and only checks the operators for
    valid field names.

    Closes-bug: #1294628
    Change-Id: Id34ae882940b36dec3ea81043b0d29b996a38426

Changed in ceilometer:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/82813

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (stable/havana)

Reviewed: https://review.openstack.org/82813
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=bbab3d5bcfe32e4543ca49df7f2497cf5192ea75
Submitter: Jenkins
Branch: stable/havana

commit bbab3d5bcfe32e4543ca49df7f2497cf5192ea75
Author: Ildiko Vancsa <email address hidden>
Date: Wed Mar 19 15:31:31 2014 +0100

    Fix validation error for invalid field name in simple query

    The field name validation code runs only in case of the operator that is
    specified for the invalid field name, is 'eq'. Otherwise the validation
    ends with an invalid operator error. The field name validation code was
    modified to check the field name first and only checks the operators for
    valid field names.

    Closes-bug: #1294628

    Change-Id: Id34ae882940b36dec3ea81043b0d29b996a38426
    (cherry picked from commit 50cffbc08f24ff8e3935aabecdf4be0fb366116d)

Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: icehouse-rc1 → 2014.1
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.