Rename _find_router_port_by_network_and_device_owner

This is actually finding the v6 port, rename it base on the discussion
at https://review.openstack.org/#/c/315926

Change-Id: Ibc91067be3d38934cb55c82e3d792b2990180fc7
Related-bug: #1581348
This commit is contained in:
Hong Hui Xiao 2016-05-20 02:49:47 +00:00
parent 084173338e
commit 851d39df90
1 changed files with 6 additions and 5 deletions

View File

@ -289,9 +289,10 @@ class L3_NAT_with_dvr_db_mixin(l3_db.L3_NAT_db_mixin,
if subnet['ip_version'] == 6:
# Add new prefix to an existing ipv6 csnat port with the
# same network id if one exists
cs_port = self._find_router_port_by_network_and_device_owner(
router, subnet['network_id'],
const.DEVICE_OWNER_ROUTER_SNAT)
cs_port = (
self._find_v6_router_port_by_network_and_device_owner(
router, subnet['network_id'],
const.DEVICE_OWNER_ROUTER_SNAT))
if cs_port:
fixed_ips = list(cs_port['port']['fixed_ips'])
fixed_ips.append(fixed_ip)
@ -329,7 +330,7 @@ class L3_NAT_with_dvr_db_mixin(l3_db.L3_NAT_db_mixin,
return super(L3_NAT_with_dvr_db_mixin,
self)._port_has_ipv6_address(port)
def _find_router_port_by_network_and_device_owner(
def _find_v6_router_port_by_network_and_device_owner(
self, router, net_id, device_owner):
for port in router.attached_ports:
p = port['port']
@ -351,7 +352,7 @@ class L3_NAT_with_dvr_db_mixin(l3_db.L3_NAT_db_mixin,
if router.gw_port:
# If router has a gateway port, check if it has IPV6 subnet
cs_port = (
self._find_router_port_by_network_and_device_owner(
self._find_v6_router_port_by_network_and_device_owner(
router, network_id, const.DEVICE_OWNER_ROUTER_SNAT))
if cs_port:
fixed_ips = (