]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Refactor _update_ips_for_port
authorPavel Bondar <pbondar@infoblox.com>
Wed, 10 Jun 2015 11:56:58 +0000 (14:56 +0300)
committerCarl Baldwin <carl.baldwin@hp.com>
Mon, 15 Jun 2015 17:12:55 +0000 (17:12 +0000)
commita89f99c6b700b1c6f918fe359c7271ac25ed4bc4
treef219a67c46a00e8a68240c8ce99e498e4465c183
parent1ab4fc7319010ddd5584451feccf78b704bd09c6
Refactor _update_ips_for_port

This commit is a preparation step for using pluggable IPAM.
_update_ips_for_port was refactored and split into two methods:
- _get_changed_ips_for_port
  This method contains calculations common for pluggable and
  non-pluggable IPAM implementation, was moved to ipam_backend_mixin.
- _update_ips_for_port
  This method is specific for non-pluggable IPAM implementation, so it
  was moved to ipam_non_pluggable_backend_common.

Other changes:
- _update_ips_for_port now returns namedtuple with added, removed, original
  ips (previously added and original ips were returned).
  List of removed ips is required by pluggable IPAM implementaion
  to apply rollback-on-failure logic;
- removed unused port_id argument from _update_ips_for_port argument list;

Partially-Implements: blueprint neutron-ipam

Change-Id: Id50b6227c8c2d94c35473aece080a6f106a5dfd8
neutron/db/db_base_plugin_v2.py
neutron/db/ipam_backend_mixin.py
neutron/db/ipam_non_pluggable_backend.py
neutron/tests/unit/db/test_ipam_backend_mixin.py [new file with mode: 0644]