LazyPluggable doesn't support option groups

Bug #1093043 reported by aeva black
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Davanum Srinivas (DIMS)
oslo-incubator
Won't Fix
Undecided
Davanum Srinivas (DIMS)

Bug Description

While converting the baremetal options to use an OptGroup, I tried to convert baremetal_db_backend to baremetal.db_backend. This option is used just like Nova's db_backend, in that it is loaded via utils.LazyPluggable, however I haven't been able to find a way to get utils.LazyPluggable to read from the "baremetal" option group.

See comments on this review:
  https://review.openstack.org/#/c/18563/1/nova/virt/baremetal/db/api.py

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

Looks like the key is CONF[self.__pivot] needs to work with "baremetal.db_backend".

        if not self.__backend:
            backend_name = CONF[self.__pivot]
            if backend_name not in self.__backends:
                msg = _('Invalid backend: %s') % backend_name
                raise exception.NovaException(msg)

Basically we need to look up the group first and then lookup the key in the group. Easiest way is to enhance cfg._get_opt_info to deal with "baremetal.db_backend"

Changed in nova:
assignee: nobody → Davanum Srinivas (dims-v)
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

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

Changed in oslo:
assignee: nobody → Davanum Srinivas (dims-v)
status: New → In Progress
Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo-incubator (master)

Reviewed: https://review.openstack.org/18676
Committed: http://github.com/openstack/oslo-incubator/commit/525ac47bb934621057904725376108f56f6c57fe
Submitter: Jenkins
Branch: master

commit 525ac47bb934621057904725376108f56f6c57fe
Author: Davanum Srinivas <email address hidden>
Date: Wed Dec 26 22:50:35 2012 -0500

    Support lookup of value using "group.key"

    Let us check if the opt_name has a '.', if it does then split it
    into a group/key and try lookup using that combination. Since
    LazyPluggable uses "CONF[self.__pivot]" if we just add this
    capability to cfg, we get "LazyPluggable doesn't support
    option groups" for free.

    Fixes LP #1093043

    Change-Id: I9cedcf22014038e9fe4ed5e66ca5427aa99b5091

Changed in oslo:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Revision history for this message
Mark McLoughlin (markmc) wrote :

I've left a suggestion in https://review.openstack.org/19236 for how to more easily support config groups in LazyPluggable

I've also proposed a revert of the cfg change: https://review.openstack.org/19243

Changed in oslo:
status: Fix Committed → Won't Fix
Changed in nova:
status: In Progress → Confirmed
assignee: Davanum Srinivas (DIMS) (dims-v) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in nova:
assignee: nobody → Davanum Srinivas (DIMS) (dims-v)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/20203
Committed: http://github.com/openstack/nova/commit/52bee33eca1719bc01318cdef5f95c2b48992c0a
Submitter: Jenkins
Branch: master

commit 52bee33eca1719bc01318cdef5f95c2b48992c0a
Author: Davanum Srinivas <email address hidden>
Date: Mon Jan 21 21:18:34 2013 -0500

    Add support for Option Groups in LazyPluggable

    Use @markmc's suggestion to enhance LazyPluggable with an
    optional config group. Also fix the baremetal database
    backend option to use the "baremetal" config group.

    Fixes LP #1093043

    Change-Id: I28cf51a2962f516fcef4ced19e30c985220e86dc

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-3 → 2013.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.