- vlan_if_name = Topology.get_interface_name(node, node_vlan_if)
-
- if vxlan_count > 10:
- tmp_fn = '/tmp/put_subinterfaces_up.config'
- commands = list()
- for i in xrange(0, vxlan_count):
- vxlan_subif_key = Topology.add_new_port(node, 'vxlan_tunnel')
- vxlan_subif_name = 'vxlan_tunnel{nr}'.format(nr=i)
- vxlan_found = False
- vxlan_subif_idx = None
- vlan_subif_key = Topology.add_new_port(node, 'vlan_subif')
- vlan_subif_name = '{if_name}.{vlan}'.format(
- if_name=vlan_if_name, vlan=i + 1)
- vlan_found = False
- vlan_idx = None
- for data in if_data:
- if_name = data['interface_name']
- if not vxlan_found and if_name == vxlan_subif_name:
- vxlan_subif_idx = data['sw_if_index']
- vxlan_found = True
- elif not vlan_found and if_name == vlan_subif_name:
- vlan_idx = data['sw_if_index']
- vlan_found = True
- if vxlan_found and vlan_found:
- break
- Topology.update_interface_sw_if_index(
- node, vxlan_subif_key, vxlan_subif_idx)
- Topology.update_interface_name(
- node, vxlan_subif_key, vxlan_subif_name)
- commands.append(
- 'sw_interface_set_flags sw_if_index {sw_idx} admin-up '
- 'link-up\n'.format(sw_idx=vxlan_subif_idx))
- Topology.update_interface_sw_if_index(
- node, vlan_subif_key, vlan_idx)
- Topology.update_interface_name(
- node, vlan_subif_key, vlan_subif_name)
- commands.append(
- 'sw_interface_set_flags sw_if_index {sw_idx} admin-up '
- 'link-up\n'.format(sw_idx=vlan_idx))
- VatExecutor().write_and_execute_script(node, tmp_fn, commands)
- return
-
- cmd = 'sw_interface_set_flags'