The @plugin_base.check_keystone mechanism is broken

Bug #1494592 reported by Mehdi Abaakouk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
High
Mehdi Abaakouk

Bug Description

Hi,

The decorator @plugin_base.check_keystone expected the service_type as parameter.
Each time, this one is passed to the decorator it comes from cfg.CONF, but because this is a decorator, this is evaluated when the module is loaded; not at run times.

For example for neutron discovery services, that means that cfg.CONF.service_types.neutron is not yet initialised, so we always got the default value, and not the one written in the config file.

Cheers,

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

Changed in ceilometer:
assignee: nobody → Mehdi Abaakouk (sileht)
status: New → In Progress
gordon chung (chungg)
Changed in ceilometer:
importance: Undecided → High
gordon chung (chungg)
Changed in ceilometer:
milestone: none → liberty-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

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

commit 840feeab4feb4fe67b8f7bbf8dc264897e65615c
Author: Mehdi Abaakouk <email address hidden>
Date: Fri Sep 11 08:38:52 2015 +0200

    Refactor keystone handling in discovery manager

    The current code assumes the keytone attribute of the manager is a
    keystone client object but sometimes this is not true, this is
    the exception raised by keystoneclient.

    This is not sane to store two differents things in same attribute.
    This change fixes that, by storing only the keystone client object and
    just reraise the keystoneclient exception when keystone is unavailable.

    So the discovery process can detect that keystone is unavailable by
    catching the base exception of the keystoneclient library and
    just skip discovery plugin with an appropriate message.

    Another advantage is that we will not swallow anymore unexpected keystone
    client issue by a simple keystone authentication message.

    The check_keystone won't work as expected too. Usage of cfg.CONF into a
    decorator is broken. This refactor moves the code into the discover
    method.

    Change-Id: I6adabd7c09672af20e8fabb5016bd2978564e1b2
    Closes-Bug: 1493056
    Closes-Bug: 1494592

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: 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.