[openstack-dev] [oslo][All] Make CONF.set_override with paramter enforce_type=True by default

Markus Zoeller mzoeller at de.ibm.com
Tue Nov 17 17:10:14 UTC 2015


ChangBo Guo <glongwave at gmail.com> wrote on 11/17/2015 01:29:53 PM:

> From: ChangBo Guo <glongwave at gmail.com>
> To: "OpenStack Development Mailing List (not for usage questions)" 
> <openstack-dev at lists.openstack.org>
> Date: 11/17/2015 01:37 PM
> Subject: [openstack-dev] [oslo][All] Make CONF.set_override with 
> paramter enforce_type=True by default
> 
> Hi ALL,

> 1. Problems :
>    oslo_config provides method CONF.set_override[1] , developers 
> usually use it to change config option's value in tests. That's 
convenient .
>    By default  parameter enforce_type=False,  it doesn't check any 
> type or value of override. If set enforce_type=True , will check 
parameter
>    override's type and value.  In production code(running time code), 
> oslo_config  always checks  config option's value.
>    In short, we test and run code in different ways. so there's  gap: 
> config option with wrong type or invalid value can pass tests when
>    parameter enforce_type = False in consuming projects.  that means 
> some invalid or wrong tests are in our code base.
>    There is nova POC result when I enable "enforce_type=true" [2],  
> and I must fix them in [3]
> 
>    [1] https://github.com/openstack/oslo.config/blob/master/
> oslo_config/cfg.py#L2173
>    [2] http://logs.openstack.org/16/242416/1/check/gate-nova-python27/
> 97b5eff/testr_results.html.gz
>    [3]  https://review.openstack.org/#/c/242416/  https://
> review.openstack.org/#/c/242717/  
https://review.openstack.org/#/c/243061/
> 
> 2. Proposal 
>    1) Make  method CONF.set_override with  enforce_type=True  in 
> consuming projects. and  fix violations when  enforce_type=True in each 
project.
> 
>   2) Make  method CONF.set_override with  enforce_type=True by default
> in oslo_config
> 
>    Hope some one from consuming projects can help make  
> enforce_type=True in consuming projects and fix violations,
> 
>    You can find more details and comments  in  https://
> etherpad.openstack.org/p/enforce_type_true_by_default
> 
> -- 
> ChangBo Guo(gcb)


Does it make sense to introduce a hacking check when your changes are
merged? To prevent that new things slip in in Nova during the time period
until "oslo.config" changes the default value?

Regards, Markus Zoeller (markus_z)




More information about the OpenStack-dev mailing list