ceilometermiddleware listener incorrect key check

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

Bug Description

i incorrectly used: "if message['payload']['measurements']:" to check for valid key (https://github.com/openstack/ceilometer/blob/master/ceilometer/objectstore/notifications.py#L72)

this is causing notification logs to be littered with errors:

2015-03-23 19:19:00.859 31517 ERROR oslo_messaging.notify.dispatcher [-] Exception during message handling
2015-03-23 19:19:00.859 31517 TRACE oslo_messaging.notify.dispatcher Traceback (most recent call last):
2015-03-23 19:19:00.859 31517 TRACE oslo_messaging.notify.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/notify/dispatcher.py", line 91, in _dispatch_and_handle_error
2015-03-23 19:19:00.859 31517 TRACE oslo_messaging.notify.dispatcher executor_callback)
2015-03-23 19:19:00.859 31517 TRACE oslo_messaging.notify.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/notify/dispatcher.py", line 134, in _dispatch
2015-03-23 19:19:00.859 31517 TRACE oslo_messaging.notify.dispatcher metadata)
2015-03-23 19:19:00.859 31517 TRACE oslo_messaging.notify.dispatcher File "/opt/stack/new/ceilometer/ceilometer/agent/plugin_base.py", line 159, in info
2015-03-23 19:19:00.859 31517 TRACE oslo_messaging.notify.dispatcher self.to_samples_and_publish(context.get_admin_context(), notification)
2015-03-23 19:19:00.859 31517 TRACE oslo_messaging.notify.dispatcher File "/opt/stack/new/ceilometer/ceilometer/agent/plugin_base.py", line 187, in to_samples_and_publish
2015-03-23 19:19:00.859 31517 TRACE oslo_messaging.notify.dispatcher p(list(self.process_notification(notification)))
2015-03-23 19:19:00.859 31517 TRACE oslo_messaging.notify.dispatcher File "/opt/stack/new/ceilometer/ceilometer/objectstore/notifications.py", line 72, in process_notification
2015-03-23 19:19:00.859 31517 TRACE oslo_messaging.notify.dispatcher if message['payload']['measurements']:
2015-03-23 19:19:00.859 31517 TRACE oslo_messaging.notify.dispatcher KeyError: 'measurements'
2015-03-23 19:19:00.859 31517 TRACE oslo_messaging.notify.dispatcher

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

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/166998
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=2b6b724e4f6dc1de9d8b3fca705324458c03dd9b
Submitter: Jenkins
Branch: master

commit 2b6b724e4f6dc1de9d8b3fca705324458c03dd9b
Author: gordon chung <email address hidden>
Date: Mon Mar 23 16:26:49 2015 -0400

    fix incorrect key check in swift notifications

    ceilometermiddleware emits notifications that may or may not contain
    measurement values. the original key check logic i added is not
    correct so this fixes it.

    Change-Id: Ib18e29457673cf9f67125c3d453c98fec075f16b
    Closes-Bug: #1435533

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: kilo-rc1 → 2015.1.0
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.