[openstack-dev] [oslo] Option conflict when mixing projects
Doug Hellmann
doug.hellmann at dreamhost.com
Thu Feb 21 18:59:54 UTC 2013
On Thu, Feb 21, 2013 at 10:03 AM, Mark McLoughlin <markmc at redhat.com> wrote:
> On Wed, 2013-02-20 at 15:07 +0100, Julien Danjou wrote:
> > On Wed, Feb 20 2013, Mark McLoughlin wrote:
> >
> > > I don't know exactly what you're trying to achieve here, but if you
> need
> > > different RPC configuration for ceilometer code in nova-compute then
> you
> > > need a separate configuration file and a separate ConfigOpts object
> > >
> > > Basically, there should be a way to pass an object other than
> > > oslo.confg.cfg.CONF to the RPC calls.
> >
> > Ok, but the underlying problem is that we don't control what
> > openstack.common.rpc does, and it registers its options at import time.
> >
> > So how can we, Ceilometer, fix this case:
> >
> > >>> import nova.openstack.common.rpc
> > >>> import ceilometer.openstack.common.rpc
> >
> > on our own?
> >
> > (Hint: the answer "don't do that" isn't valid :-))
>
> Ok, I took a poke at this and hacked up a patch that's probably broken
> in a million different ways.
>
> The tl;dr is that we can add an rpc.get_impl() function quite easily but
> ceilometer will require quite a bit of conf to ensure no code run by
> nova_notifer uses cfg.CONF:
>
> https://github.com/markmc/ceilometer/commits/non-global-conf
>
> Allow nova_notifier use non-global config
>
> The nova_notifer code runs in the context of nova, so if we use
> cfg.CONF
> then we are reading options from nova.conf. Instead, we want to read
> config options from ceilometer.conf.
>
> To achieve that, all of ceilometers code which is used by nova_notifier
> needs to accept a ConfigOpts object created by nova_notifier. The code
> needs to both register and read config options from this object.
>
> When we get down to meter_publish, the calls to the oslo RPC code also
> need to be passed this ConfigOpts object. To facilitate this, we add
> a new rpc.get_impl() function which needs to be proposed to
> oslo-incubator.
>
> I've also filed this bug:
>
> https://bugs.launchpad.net/oslo/+bug/1131233
I filed https://bugs.launchpad.net/ceilometer/+bug/1130952 and have started
working on a new implementation for the notifier that minimizes the amount
of ceilometer code that it imports as a side-effect.
I still think we should do what we can to start moving away from global
state for the config, but these changes will give us more time to think
about how to do that cleanly.
Doug
>
>
> Cheers,
> Mark.
>
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130221/41c2d230/attachment.html>
More information about the OpenStack-dev
mailing list