Skip to content

Commit 99c05d5

Browse files
authored
add vlan_intf_object only if there are ipv4 or ipv6 mappings (#1377)
1 parent b082684 commit 99c05d5

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

scripts/neighbor_advertiser

+10-9
Original file line numberDiff line numberDiff line change
@@ -302,17 +302,18 @@ def construct_neighbor_advertiser_slice():
302302
ipv6_mappings.append(mapping)
303303
ctr += 1
304304

305-
vlan_interface_obj = {
306-
'vlanId': vlan_id,
307-
'vxlanId': vxlan_id,
308-
'ipv4AddrMappings': ipv4_mappings,
309-
'ipv6AddrMappings': ipv6_mappings
310-
}
305+
if len(ipv4_mappings) > 0 or len(ipv6_mappings) > 0:
306+
vlan_interface_obj = {
307+
'vlanId': vlan_id,
308+
'vxlanId': vxlan_id,
309+
'ipv4AddrMappings': ipv4_mappings,
310+
'ipv6AddrMappings': ipv6_mappings
311+
}
311312

312-
if vxlanPort:
313-
vlan_interface_obj['vxlanPort'] = vxlanPort
313+
if vxlanPort:
314+
vlan_interface_obj['vxlanPort'] = vxlanPort
314315

315-
vlan_interfaces_obj.append(vlan_interface_obj)
316+
vlan_interfaces_obj.append(vlan_interface_obj)
316317

317318
slice_obj = {
318319
'switchInfo': switch_info_obj,

0 commit comments

Comments
 (0)