]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Avoid DB errors when deleting network's ports and subnets
authorOleg Bondarev <obondarev@mirantis.com>
Wed, 12 Aug 2015 17:02:01 +0000 (20:02 +0300)
committerOleg Bondarev <obondarev@mirantis.com>
Thu, 3 Sep 2015 05:57:03 +0000 (05:57 +0000)
commita55e10cfd6369533f0cc22edd6611c9549b8f1b4
tree2863f36ccc61cb49be4d136f3ce1ac3d736533a5
parent19d913bdc9e5f25aad5afa2949fd58bbd9e0122c
Avoid DB errors when deleting network's ports and subnets

DB errors may occur when accessing query results
after the transaction was closed (like ObjectDeletedError).
Hence it's better to avoid DB object access especially
when it's not needed.
This patch changes _delete_ports() and _delete_subnets() to accept
only ids. Indeed, there is no need to pass db objects to these methods.

Closes-Bug: #1484135
Related-Bug: #1454408
Change-Id: I7507cb1c85defb2e6d5144e5832aea713d6251ae
neutron/plugins/ml2/plugin.py
neutron/tests/unit/plugins/ml2/test_plugin.py