Merge "Isolate use of fixed_ips[0] to avoid confusion"
This commit is contained in:
commit
9b0577ed43
|
@ -358,9 +358,10 @@ class OVSDVRNeutronAgent(object):
|
||||||
|
|
||||||
def _bind_distributed_router_interface_port(self, port, lvm,
|
def _bind_distributed_router_interface_port(self, port, lvm,
|
||||||
fixed_ips, device_owner):
|
fixed_ips, device_owner):
|
||||||
# since router port must have only one fixed IP, directly
|
# since distributed router port must have only one fixed
|
||||||
# use fixed_ips[0]
|
# IP, directly use fixed_ips[0]
|
||||||
subnet_uuid = fixed_ips[0]['subnet_id']
|
fixed_ip = fixed_ips[0]
|
||||||
|
subnet_uuid = fixed_ip['subnet_id']
|
||||||
csnat_ofport = constants.OFPORT_INVALID
|
csnat_ofport = constants.OFPORT_INVALID
|
||||||
ldm = None
|
ldm = None
|
||||||
if subnet_uuid in self.local_dvr_map:
|
if subnet_uuid in self.local_dvr_map:
|
||||||
|
@ -498,24 +499,25 @@ class OVSDVRNeutronAgent(object):
|
||||||
|
|
||||||
def _bind_centralized_snat_port_on_dvr_subnet(self, port, lvm,
|
def _bind_centralized_snat_port_on_dvr_subnet(self, port, lvm,
|
||||||
fixed_ips, device_owner):
|
fixed_ips, device_owner):
|
||||||
|
# since centralized-SNAT (CSNAT) port must have only one fixed
|
||||||
|
# IP, directly use fixed_ips[0]
|
||||||
|
fixed_ip = fixed_ips[0]
|
||||||
if port.vif_id in self.local_ports:
|
if port.vif_id in self.local_ports:
|
||||||
# throw an error if CSNAT port is already on a different
|
# throw an error if CSNAT port is already on a different
|
||||||
# dvr routed subnet
|
# dvr routed subnet
|
||||||
ovsport = self.local_ports[port.vif_id]
|
ovsport = self.local_ports[port.vif_id]
|
||||||
subs = list(ovsport.get_subnets())
|
subs = list(ovsport.get_subnets())
|
||||||
if subs[0] == fixed_ips[0]['subnet_id']:
|
if subs[0] == fixed_ip['subnet_id']:
|
||||||
return
|
return
|
||||||
LOG.error(_LE("Centralized-SNAT port %(port)s on subnet "
|
LOG.error(_LE("Centralized-SNAT port %(port)s on subnet "
|
||||||
"%(port_subnet)s already seen on a different "
|
"%(port_subnet)s already seen on a different "
|
||||||
"subnet %(orig_subnet)s"), {
|
"subnet %(orig_subnet)s"), {
|
||||||
"port": port.vif_id,
|
"port": port.vif_id,
|
||||||
"port_subnet": fixed_ips[0]['subnet_id'],
|
"port_subnet": fixed_ip['subnet_id'],
|
||||||
"orig_subnet": subs[0],
|
"orig_subnet": subs[0],
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
# since centralized-SNAT (CSNAT) port must have only one fixed
|
subnet_uuid = fixed_ip['subnet_id']
|
||||||
# IP, directly use fixed_ips[0]
|
|
||||||
subnet_uuid = fixed_ips[0]['subnet_id']
|
|
||||||
ldm = None
|
ldm = None
|
||||||
subnet_info = None
|
subnet_info = None
|
||||||
if subnet_uuid not in self.local_dvr_map:
|
if subnet_uuid not in self.local_dvr_map:
|
||||||
|
|
Loading…
Reference in New Issue