Wrong Alarm Data samples in document

Bug #1238453 reported by Haomeng,Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Low
Pradeep Kilambi

Bug Description

The POST samples in document for Alaem is not working:

{
    "alarm_actions": [
        "http://site:8000/alarm"
    ],
    "alarm_id": null,
    "combination_rule": null,
    "description": "An alarm",
    "enabled": true,
    "insufficient_data_actions": [
        "http://site:8000/nodata"
    ],
    "name": "SwiftObjectAlarm",
    "ok_actions": [
        "http://site:8000/ok"
    ],
    "project_id": "c96c887c216949acbdfbd8b494863567",
    "repeat_actions": false,
    "state": "ok",
    "state_timestamp": "2013-10-10T16:16:53.392634",
    "threshold_rule": null,
    "timestamp": "2013-10-10T16:16:53.392627",
    "type": "threshold",
    "user_id": "c96c887c216949acbdfbd8b494863567"
}

Error message in Log:

AttributeError: 'NoneType' object has no attribute 'as_dict'

2013-10-09 04:18:38.028 23872 ERROR wsme.api [-] Server-side error: "'NoneType' object has no attribute 'as_dict'". Detail:
Traceback (most recent call last):

  File "/usr/lib/python2.6/site-packages/wsmeext/pecan.py", line 72, in callfunction
    result = f(self, *args, **kwargs)

  File "/usr/lib/python2.6/site-packages/ceilometer/api/controllers/v2.py", line 1393, in post
    change = data.as_dict(storage.models.Alarm)

  File "/usr/lib/python2.6/site-packages/ceilometer/api/controllers/v2.py", line 1156, in as_dict
    d['rule'] = getattr(self, "%s_rule" % self.type).as_dict()

AttributeError: 'NoneType' object has no attribute 'as_dict'

Haomeng,Wang (whaom)
Changed in ceilometer:
assignee: nobody → Haomeng,Wang (whaom)
Revision history for this message
Julien Danjou (jdanjou) wrote :

I hit this too, this is because the validation when threshold_rule is null is not good enough.

Changed in ceilometer:
status: New → Confirmed
importance: Undecided → Low
tags: added: havana-backport-potential
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/66757

Changed in ceilometer:
assignee: Haomeng,Wang (whaom) → Pradeep Kilambi (pkilambi)
status: Confirmed → In Progress
gordon chung (chungg)
Changed in ceilometer:
milestone: none → icehouse-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

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

commit a1b1fdac6a432ddeb4d265a19e7b945a16a19bba
Author: Pradeep Kilambi <email address hidden>
Date: Tue Jan 14 19:46:27 2014 -0800

    Fix to handle null threshold_rule values

    check if threshold_rule and combination_rule values
    are None and raise the right error in the validation
    method instead of propagating it further causing
    unhandled exceptions.

    fixes bug #1238453

    Change-Id: I70a397c89d974e489fd0ccc4ab28d73aed51443f

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-2 → 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.