[openstack-dev] [oslo][glance] Oslo.cfg resets not really resetting the CONF
markmc at redhat.com
Tue Dec 17 06:22:15 UTC 2013
On Tue, 2013-12-17 at 11:17 +0530, Amala Basha Alungal wrote:
> Hi Mark, Ben
> The reset() method in turn calls the clear() method which does an
> unregister_opt(). However the unregister_opt only unregisters the
> config_opts. The entire set of options inside _opts remain as is.
> We've filed a bug on the oslo end.
Yes, that's working as designed.
Those two options are registered by __call__() so reset() unregisters
The idea is that you can register lots and then do __call__() and
reset() without affecting the registered options.
> On Tue, Dec 17, 2013 at 5:27 AM, Mark McLoughlin <markmc at redhat.com>
> On Fri, 2013-12-13 at 14:14 +0530, Amala Basha Alungal wrote:
> > Hi,
> > I stumbled into a situation today where in I had to write
> few tests that
> > modifies the oslo.config.cfg and in turn resets the values
> back in a tear
> > down. Acc to the docs, oslo.cfg reset() "*Clears the object
> state and
> > unsets overrides and defaults." *but, it doesn't seem to be
> happening, as
> > the subsequent tests that are run retains these modified
> values and tests
> > behave abnormally. The patch has been submitted for review
> > here<https://review.openstack.org/#/c/60188/1>.
> > Am I missing something obvious?
> From https://bugs.launchpad.net/oslo/+bug/1261376 :
> reset() will clear any values read from the command line or
> files and it will also remove any values set with
> set_default() or
> However, it will not undo register_opt() - there is
> for that purpose
> Maybe if you pushed a version of
> which uses reset() and explain how it's not working as you
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> Thanks And Regards
> Amala Basha
More information about the OpenStack-dev