]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Make '_create_router' function handle Boolean kwargs correctly
authorBob Melander <bob.melander@gmail.com>
Sat, 27 Jun 2015 17:14:19 +0000 (19:14 +0200)
committerBob Melander <bob.melander@gmail.com>
Sun, 28 Jun 2015 01:20:43 +0000 (03:20 +0200)
commite28aa9761751d7fa12dba1c35076c3c975b7cd3f
tree0d72dbdb9e9cafc5c7029fb6f80c169bdb7ff33f
parent42e9585494a2db6eca6a53093e3e269d1a95f91c
Make '_create_router' function handle Boolean kwargs correctly

The function allows arbitrary kw arguments to be specificed.
Those kw arguments whose key is specified in the function
parameter 'arg_list' are then passed in the create router REST
API call.

The code line that checks if a kw argument key is included in
'arg_list' does not work with Boolean kw arguments. Nor does it
work with None kw argument values. This is a limitation as
tests in inheriting classes may need such kw arguments.

This patch fixes the faulty 'if' clause so that it simply
checks that the kw argument key is in 'arg_list'. This makes it
support Boolean kw arguments and kw arguments with value None.

Closes-Bug: #1482108
Change-Id: I5618dc4d5c803c7614dd1f579db3c79928007fb6
neutron/tests/unit/extensions/test_l3.py