@@ -308,6 +308,10 @@ def update_port_postcommit(self, context):
308
308
# conditional based on what appears to have changed in the provided
309
309
# context versus the "original".
310
310
vlan_group_name = self ._vlan_group_name (context )
311
+ LOG .debug (
312
+ "update_port_postcommit vlan_group=%s vif_type=%s" ,
313
+ vlan_group_name , context .vif_type
314
+ )
311
315
if vlan_group_name and context .vif_type == portbindings .VIF_TYPE_OTHER :
312
316
self .invoke_undersync (vlan_group_name )
313
317
@@ -361,6 +365,9 @@ def bind_port(self, context: PortContext) -> None:
361
365
362
366
We obtain the dynamic segment for this network and vlan_group.
363
367
368
+ If there are no VXLAN segments, then bind a VLAN segment instead (this
369
+ is required for VALN_type networks like the provisioning network).
370
+
364
371
We configure the nautobot switch interface with the new VLAN(s).
365
372
366
373
Then make the required call in to the black box: context.set_binding.
@@ -373,6 +380,29 @@ def bind_port(self, context: PortContext) -> None:
373
380
self ._bind_port_segment (context , segment )
374
381
return
375
382
383
+ for segment in context .network .network_segments :
384
+ if segment [api .NETWORK_TYPE ] == p_const .TYPE_VLAN :
385
+ self ._bind_port_vlan_segment (context , segment )
386
+ return
387
+
388
+ def _bind_port_vlan_segment (self , context : PortContext , segment : dict ):
389
+ LOG .debug ("bind_port_vlan_segment %s" , segment )
390
+
391
+ if is_provisioning_network (network_id ):
392
+ self ._set_nautobot_port_status (context , "Provisioning-Interface" )
393
+ else :
394
+ LOG .info (
395
+ "bind_port_vlan_segment won't configure segment in nautobot %s" ,
396
+ segment
397
+ )
398
+
399
+ context .set_binding (
400
+ segment [api .ID ],
401
+ portbindings .VIF_TYPE_OTHER ,
402
+ {},
403
+ status = p_const .PORT_STATUS_ACTIVE ,
404
+ )
405
+
376
406
def _bind_port_segment (self , context : PortContext , segment ):
377
407
trunk_details = context .current .get ("trunk_details" , {})
378
408
network_id = context .current ["network_id" ]
@@ -382,11 +412,6 @@ def _bind_port_segment(self, context: PortContext, segment):
382
412
)
383
413
vlan_group_name = self ._vlan_group_name (context )
384
414
385
- if is_provisioning_network (network_id ):
386
- LOG .debug ("bind_port_segment side-stepping provisioning interface" )
387
- self ._set_nautobot_port_status (context , "Provisioning-Interface" )
388
- return
389
-
390
415
LOG .debug (
391
416
"bind_port_segment interface %s network %s type %s" ,
392
417
connected_interface_uuid ,
0 commit comments