[openstack-dev] [oslo][glance] Oslo.cfg resets not really resetting the CONF

Mark McLoughlin 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
only them.

The idea is that you can register lots and then do __call__() and
reset() without affecting the registered options.

Mark.

> On Tue, Dec 17, 2013 at 5:27 AM, Mark McLoughlin <markmc at redhat.com>
> wrote:
>         Hi
>         
>         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
>         config
>           files and it will also remove any values set with
>         set_default() or
>           set_override()
>         
>           However, it will not undo register_opt() - there is
>         unregister_opt()
>           for that purpose
>         
>         Maybe if you pushed a version of
>         https://review.openstack.org/60188
>         which uses reset() and explain how it's not working as you
>         expected?
>         
>         Thanks,
>         Mark.
>         
>         
>         _______________________________________________
>         OpenStack-dev mailing list
>         OpenStack-dev at lists.openstack.org
>         http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> 
> 
> 
> -- 
> Thanks And Regards
> Amala Basha
> +91-7760972008





More information about the OpenStack-dev mailing list