[openstack-dev] [trove][neutron][cinder][swift][ceilometer][nova][keystone][sahara][glance][neutron-lbaas][imm] stylistic changes to code, how do we handle them?

Michał Dulko michal.dulko at intel.com
Tue Jan 12 14:10:09 UTC 2016


On 01/12/2016 03:02 PM, Chris Dent wrote:
> On Tue, 12 Jan 2016, Amrith Kumar wrote:
>
>> if var > 0:
>>     ... something ...
>>
>> To
>>
>> if var:
>>     ... something ...
>
> I may be missing something but the above is not a stylistic change
> if var can ever be negative. In one of the ceilometer changes[1] for
> example, this change will change the flow of the code. In this
> particular example if some caller do _do_test_iter_images sends
> page_size=-1 bad things will happen. Since it is test code the scope
> of the damage is limited, but I prefer the more explicit > 0.
>
> I've not checked all the reviews but if it is showing up in one
> place seems like it could in others.
>
> [1]
> https://review.openstack.org/#/c/266211/1/ceilometer/tests/unit/image/test_glance.py
>

Same thing for Cinder change - it's failing multiple unit tests because
this changes the logic of the statement.



More information about the OpenStack-dev mailing list