CONF.notification_driver should be StrMultiOpt

Bug #1025820 reported by Andrew Bogott
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-common
Fix Released
Medium
Andrew Bogott

Bug Description

Right now we have an optional notifier driver, list_notifier, which handles n notifiers. It works perfectly well for n = 0 or 1, so there's no real reason to not always use the list notifier. And, going further, there's no reason to consider the list_notifier to be a driver at all; the list behavior should be promoted into the notifier api so that the notifier api always handles n drivers rather than 0 or 1.

The problem that this solves:

There's code in the pluginmanager that switches CONF.notification_driver to the list_notifier driver and then adds the previous CONF.notification_driver to the list. This works, but fiddling with config opts in code is problematic in various ways (among other things, it confounds the tests which expect config values to only be set at startup or via the testing framework.)

Problems this might cause:

Thanks to the existing behavior of StrMultiOpt, existing installs that set CONF.list_notifier once, e.g.

$ notification_driver = foozle

...will still work as before. If, however, someone has a buggy nova.conf that sets CONF.list_notifier twice

$ notification_driver = foozle
$ notification_driver = oopsIMeantFazzle

...the behavior will change, as previously only the second driver was used, but in the StrMultiOpt scenario both drivers will be used.

This could be avoided by instituting a new CONF.notification_drivers flag and leaving in a special-case handler if CONF.notification_driver is set instead. No idea if that is necessary though.

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

At first glance, making it MultiStrOpt seems reasonable to me

MultiStrOpts should be singular, ListOpts should be plural i.e.

  notification_driver = foo
  notification_driver = bar

vs

  notification_drivers = foo,bar

description: updated
Revision history for this message
Matt Dietz (cerberus) wrote :

Seems like a reasonable fix to make, I approve. Despite my original misgivings that the list_notifier could abused (and nova unnecessarily slowed) I think this is a valid rewrite.

Changed in openstack-common:
assignee: nobody → Andrew Bogott (andrewbogott)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-common (master)

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

Changed in openstack-common:
status: New → In Progress
Mark McLoughlin (markmc)
Changed in openstack-common:
milestone: none → folsom-3
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-common (master)

Reviewed: https://review.openstack.org/10035
Committed: http://github.com/openstack/openstack-common/commit/c767e9beffe4b826eac869ce7e2eef2cc1499bbe
Submitter: Jenkins
Branch: master

commit c767e9beffe4b826eac869ce7e2eef2cc1499bbe
Author: Andrew Bogott <email address hidden>
Date: Thu Jul 19 03:34:31 2012 -0500

    Add multiple-driver support to the notifier api.

    Move all of the functionality previously provided by the list_notifier
    into the basic notifier api. Move and restructure tests accordingly.

    Remove the list_notifier file and test file.

    For bug 1025820

    Change-Id: Idf7cb975dd78e9951188781622a4d10ca466b154

Changed in openstack-common:
status: In Progress → Fix Committed
Mark McLoughlin (markmc)
Changed in openstack-common:
milestone: folsom-3 → 2012.2
status: Fix Committed → Fix Released
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.