Skip to content

Commit

Permalink
add vlan_intf_object only if there are ipv4 or ipv6 mappings (#1377)
Browse files Browse the repository at this point in the history
  • Loading branch information
sumukhatv authored Jan 21, 2021
1 parent b082684 commit 99c05d5
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions scripts/neighbor_advertiser
Original file line number Diff line number Diff line change
Expand Up @@ -302,17 +302,18 @@ def construct_neighbor_advertiser_slice():
ipv6_mappings.append(mapping)
ctr += 1

vlan_interface_obj = {
'vlanId': vlan_id,
'vxlanId': vxlan_id,
'ipv4AddrMappings': ipv4_mappings,
'ipv6AddrMappings': ipv6_mappings
}
if len(ipv4_mappings) > 0 or len(ipv6_mappings) > 0:
vlan_interface_obj = {
'vlanId': vlan_id,
'vxlanId': vxlan_id,
'ipv4AddrMappings': ipv4_mappings,
'ipv6AddrMappings': ipv6_mappings
}

if vxlanPort:
vlan_interface_obj['vxlanPort'] = vxlanPort
if vxlanPort:
vlan_interface_obj['vxlanPort'] = vxlanPort

vlan_interfaces_obj.append(vlan_interface_obj)
vlan_interfaces_obj.append(vlan_interface_obj)

slice_obj = {
'switchInfo': switch_info_obj,
Expand Down

0 comments on commit 99c05d5

Please sign in to comment.