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

Chris Dent cdent+os at anticdent.org
Tue Jan 12 14:02:32 UTC 2016


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

-- 
Chris Dent               (¨s¡ã¡õ¡ã)¨s¦à©ß©¥©ß            http://anticdent.org/
freenode: cdent                                         tw: @anticdent


More information about the OpenStack-dev mailing list