Handling malformed definitions in gnocchi_resources.yaml like with meters.yaml

Bug #1542189 reported by Yurii Prokulevych on 2016-02-05
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Undecided
Pradeep Kilambi

Bug Description

If gnocchi_resources.yaml has malformed definition than all definitions are ignored.

Excerpt from collector.log:
2016-02-05 07:31:12.139 30011 DEBUG ceilometer.dispatcher [-] loading dispatchers from ceilometer.dispatcher load_dispatcher_manager /usr/lib/python2.7/site-packages/ceilometer/dispatcher/__init__.py:41
2016-02-05 07:31:14.867 30011 ERROR stevedore.extension [-] Could not load 'gnocchi': ResourcesDefinitionException {'metrics': ['CustomMetric', 'CustomMetric1', 'CustomMetricRule1'], 'attributes': {'some_attribu
te': 'resource_metadata.some_attribute'}}: Required field resource_type not specified
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension [-] ResourcesDefinitionException {'metrics': ['CustomMetric', 'CustomMetric1', 'CustomMetricRule1'], 'attributes': {'some_attribute': 'resource_metadata.so
me_attribute'}}: Required field resource_type not specified
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension Traceback (most recent call last):
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension File "/usr/lib/python2.7/site-packages/stevedore/extension.py", line 162, in _load_plugins
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension verify_requirements,
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension File "/usr/lib/python2.7/site-packages/stevedore/named.py", line 123, in _load_one_plugin
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension verify_requirements,
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension File "/usr/lib/python2.7/site-packages/stevedore/extension.py", line 187, in _load_one_plugin
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension obj = plugin(*invoke_args, **invoke_kwds)
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension File "/usr/lib/python2.7/site-packages/ceilometer/dispatcher/gnocchi.py", line 182, in __init__
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension self.resources_definition = self._load_resources_definitions(conf)
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension File "/usr/lib/python2.7/site-packages/ceilometer/dispatcher/gnocchi.py", line 213, in _load_resources_definitions
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension for r in data.get('resources', [])]
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension File "/usr/lib/python2.7/site-packages/ceilometer/dispatcher/gnocchi.py", line 118, in __init__
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension _LE("Required field %s not specified") % field, self.cfg)
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension ResourcesDefinitionException: ResourcesDefinitionException {'metrics': ['CustomMetric', 'CustomMetric1', 'CustomMetricRule1'], 'attributes': {'some_attribu
te': 'resource_metadata.some_attribute'}}: Required field resource_type not specified
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension

For consistency it would be great to have the same error handling like with meters.yaml

Packages:
ceilometer*-5.0.1-1.el7ost.noarch

Regards,
Yurii

Changed in ceilometer:
assignee: nobody → Pradeep Kilambi (pkilambi)

Fix proposed to branch: master
Review: https://review.openstack.org/276879

Changed in ceilometer:
status: New → In Progress

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

commit 02b1e1399bf885d03113a1cc125b1f97ed5540b9
Author: Pradeep Kilambi <email address hidden>
Date: Fri Feb 5 14:03:28 2016 -0500

    Handle malformed resource definitions gracefully

    Change-Id: Ibfe49741ad5df82a57cc1c344a471be4d23fdffb
    Closes-bug: #1542189

Changed in ceilometer:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/280910
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=99a56e707a1bc9049b167b303501cceb7d37e65e
Submitter: Jenkins
Branch: stable/liberty

commit 99a56e707a1bc9049b167b303501cceb7d37e65e
Author: Pradeep Kilambi <email address hidden>
Date: Fri Feb 5 14:03:28 2016 -0500

    Handle malformed resource definitions gracefully

    Closes-bug: #1542189

    Conflicts:
     ceilometer/dispatcher/gnocchi.py
     ceilometer/tests/unit/dispatcher/test_gnocchi.py

    Change-Id: Ibfe49741ad5df82a57cc1c344a471be4d23fdffb
    (cherry picked from commit 02b1e1399bf885d03113a1cc125b1f97ed5540b9)

tags: added: in-stable-liberty

This issue was fixed in the openstack/ceilometer 5.0.3 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers