Merge "Rename _find_router_port_by_network_and_device_owner"

This commit is contained in:
Jenkins 2016-06-01 23:28:51 +00:00 committed by Gerrit Code Review
commit 4b14f5f05e

View File

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