The key of instance status metadata is different between notifications and polling

Bug #1491224 reported by Xiangjun Li
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Medium
Xiangjun Li
Kilo
Fix Committed
Medium
Liusheng

Bug Description

The key of instance status metadata which was generated from notification source is "state", but the key is "status" when the meter data was generated from polling. Because the meter data generated from notification or polling update the resource information in cycles, the show resource API will return the same type metadata with different key:
Sometimes it return:
{……
metadata :{'state':'active',……}
……}

But at other times, it return:
{……
metadata :{'status':'active',……}
……}

In some situations, this problems may confuse us. (e.g. Recently we develop a billing component for openstack, and we call the show resource API of ceilometer to retrieve the resource information, and get the current status of instance via code 'metadata['state']', but sometimes the above code will cause 'key error' issue due to this problem)

Xiangjun Li (lixiangjun)
Changed in ceilometer:
assignee: nobody → lixiangjun (lixiangjun)
Xiangjun Li (lixiangjun)
Changed in ceilometer:
status: New → In Progress
Lianhao Lu (lianhao-lu)
Changed in ceilometer:
importance: Undecided → Low
gordon chung (chungg)
Changed in ceilometer:
importance: Low → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

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

commit d054c7c7407f5f20e6b01f151529bf44fe8ef577
Author: xiangjun li <email address hidden>
Date: Mon Sep 14 13:14:07 2015 +0800

    Add attribute 'state' to meter metadata when source is polling

    For now, instance attribute 'state' is stored to
    metadata of meter which was generated from
    notifications. But when meter was generated from
    instance polling, 'state' is not stored to
    metadata of meter even this attribute could be
    retrieved from polling action. Because the meter
    generated from notifications or polling update
    the resource information in database in cycles,
    the resource show API may return the instance
    metadata with different style(sometimes the
    returned metadata contains 'state', but at other
    times, the 'state' is disappeared in it), which
    may confuse us in some situations. In this patch,
    'state' has been added to the meter metadata if
    the meter was generated from polling source.

    Closes-Bug: #1491224

    Change-Id: Ie869672901b1d13f9444d0ca0e7d849f5e4ffc4b

Changed in ceilometer:
status: In Progress → Fix Committed
gordon chung (chungg)
Changed in ceilometer:
milestone: none → liberty-rc1
Revision history for this message
gordon chung (chungg) wrote :
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: liberty-rc1 → 5.0.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.