alarm_id cannot be queried with /v2/query/alarms API with SQL backend

Bug #1282667 reported by Balazs Gibizer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Medium
Balazs Gibizer

Bug Description

With SqlAlchemy backend the following exception is thrown if alarm_id is inculded in the filter on the /v2/query/alarms API

2014-02-20 17:19:04.822 6305 ERROR wsme.api [-] Server-side error: "type object 'Alarm' has no attribute 'alarm_id'". Detail:
Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/wsmeext/pecan.py", line 77, in callfunction
    result = f(self, *args, **kwargs)

  File "/opt/stack/ceilometer/ceilometer/api/controllers/v2.py", line 2179, in post
    query.limit)]

  File "/opt/stack/ceilometer/ceilometer/storage/impl_sqlalchemy.py", line 798, in query_alarms
    return self._retrieve_data(filter_expr, orderby, limit, models.Alarm)

  File "/opt/stack/ceilometer/ceilometer/storage/impl_sqlalchemy.py", line 584, in _retrieve_data
    transformer.apply_filter(filter_expr)

  File "/opt/stack/ceilometer/ceilometer/storage/impl_sqlalchemy.py", line 1229, in apply_filter
    condition = self._transform(expression_tree)

  File "/opt/stack/ceilometer/ceilometer/storage/impl_sqlalchemy.py", line 1226, in _transform
    return self._handle_simple_op(operator, nodes)

  File "/opt/stack/ceilometer/ceilometer/storage/impl_sqlalchemy.py", line 1201, in _handle_simple_op
    return op(getattr(self.table, field_name), value)

AttributeError: type object 'Alarm' has no attribute 'alarm_id'

controller.lan - - [20/Feb/2014 17:19:04] "POST /v2/query/alarms HTTP/1.1" 500 127

This bug does not affect the Mongo DB backend.

Changed in ceilometer:
assignee: nobody → Balazs Gibizer (balazs-gibizer)
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/75116

Changed in ceilometer:
status: New → In Progress
Eoghan Glynn (eglynn)
Changed in ceilometer:
milestone: none → icehouse-rc1
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/75116
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=5f329a912ec83f75f23a7bc55457fd4e51ce1ddf
Submitter: Jenkins
Branch: master

commit 5f329a912ec83f75f23a7bc55457fd4e51ce1ddf
Author: Balazs Gibizer <email address hidden>
Date: Thu Feb 20 18:41:33 2014 +0100

    Rename id to alarm_id of Alarm in SqlAlchemy

    This change makes the schema more consistent.

    It also fixes a bug preventig querying alarm_id
    on /v2/query/alarms API.

    Closes-Bug: #1282667

    Change-Id: Id4d67fa5ee679fe1c8d86b8575a99bfb89e384fa

Changed in ceilometer:
status: In Progress → Fix Committed
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.