Skip to content

Commit 91af998

Browse files
committed
Fix bind_port ml2 driver interaction
We don't want to "bind" the VXLAN segments that are passed to bind_port(). We want to make a dynamic VLAN-type segment and bind that instead. We are no longer using any VLAN-type networks, so remove the code that deals with those (it was handling the provisioning network which was still confiured as VLAN type for legacy reasons, but that is now moving to VXLAN-type network, same as all the others.)
1 parent 8b5ec73 commit 91af998

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

python/neutron-understack/neutron_understack/neutron_understack_mech.py

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -383,24 +383,6 @@ def bind_port(self, context: PortContext) -> None:
383383
self._bind_port_segment(context, segment)
384384
return
385385

386-
for segment in context.network.network_segments:
387-
if segment[api.NETWORK_TYPE] == p_const.TYPE_VLAN:
388-
self._bind_port_vlan_segment(context, segment)
389-
return
390-
391-
def _bind_port_vlan_segment(self, context: PortContext, segment: dict):
392-
# We don't use VLAN-type networks for anything, so there is no real
393-
# action to take here, but we have to call set_binding to keep neutron
394-
# happy.
395-
LOG.debug("bind_port_vlan_segment %s", segment)
396-
397-
context.set_binding(
398-
segment[api.ID],
399-
portbindings.VIF_TYPE_OTHER,
400-
{},
401-
status=p_const.PORT_STATUS_ACTIVE,
402-
)
403-
404386
def _bind_port_segment(self, context: PortContext, segment):
405387
trunk_details = context.current.get("trunk_details", {})
406388
network_id = context.current["network_id"]
@@ -413,10 +395,9 @@ def _bind_port_segment(self, context: PortContext, segment):
413395
return
414396

415397
LOG.debug(
416-
"bind_port_segment interface %s network %s type %s vlan group %s",
398+
"bind_port_segment interface %s network %s vlan group %s",
417399
connected_interface_uuid,
418400
network_id,
419-
network_type,
420401
vlan_group_name,
421402
)
422403

@@ -425,7 +406,6 @@ def _bind_port_segment(self, context: PortContext, segment):
425406
physical_network=vlan_group_name,
426407
network_id=network_id,
427408
)
428-
context.continue_binding(segment["id"], [new_segment])
429409
LOG.debug("Native VLAN segment %s", new_segment)
430410
native_vlan_id = new_segment["segmentation_id"]
431411
allowed_vlan_ids = set([native_vlan_id])
@@ -453,7 +433,7 @@ def _bind_port_segment(self, context: PortContext, segment):
453433

454434
LOG.debug("set_binding for segment: %s", segment)
455435
context.set_binding(
456-
segment[api.ID],
436+
new_segment[api.ID],
457437
portbindings.VIF_TYPE_OTHER,
458438
{},
459439
status=p_const.PORT_STATUS_ACTIVE,

0 commit comments

Comments
 (0)