]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Remove use of contextlib.nested
authorankitagrawal <ankit11.agrawal@nttdata.com>
Wed, 25 Mar 2015 12:40:45 +0000 (05:40 -0700)
committerankitagrawal <ankit11.agrawal@nttdata.com>
Wed, 6 May 2015 11:43:01 +0000 (04:43 -0700)
commit4cd1600b2548b3d15cdbc9dcc368c375d2f7fee9
tree599b84584077605e7c6f8797b3efee527fedc40c
parent4bbe791e976f663105884e8eed933681b5949794
Remove use of contextlib.nested

Removed use of contextlib.nested call from codebase, as it has been
deprecated since Python 2.7.

There are also known issues with contextlib.nested that were addressed
by the native support for multiple "with" variables. For instance, if
the first object is created but the second one throws an exception,
the first object's __exit__ is never called. For more information see
https://docs.python.org/2/library/contextlib.html#contextlib.nested
contextlib.nested is also not compatible with Python 3.

This is the first patch in a series for removing use of
contextlib.nested.

Added hacking check to catch if any new instances are added to
the codebase.

Line continuation markers (e.g. '\') had to be used or syntax
errors were thrown. While using parentheses is the preferred way
for multiple line statements, but in case of long with statements
backslashes are acceptable.

Partial-Bug: 1428424
Change-Id: I171fbdb89892a3d4548bf2ca52f4a7dd9ef8dccb
13 files changed:
HACKING.rst
neutron/hacking/checks.py
neutron/tests/unit/_test_extension_portbindings.py
neutron/tests/unit/agent/dhcp/test_agent.py
neutron/tests/unit/agent/l3/test_agent.py
neutron/tests/unit/agent/linux/test_async_process.py
neutron/tests/unit/agent/linux/test_daemon.py
neutron/tests/unit/agent/metadata/test_agent.py
neutron/tests/unit/agent/metadata/test_driver.py
neutron/tests/unit/agent/test_l2population_rpc.py
neutron/tests/unit/agent/test_rpc.py
neutron/tests/unit/cmd/test_ovs_cleanup.py
neutron/tests/unit/test_policy.py