Skip to content

Commit

Permalink
Fix in vm_topology.bind when dealing with multi-hosts
Browse files Browse the repository at this point in the history
Since dut_fp_ports is a dictionary with key being the dut name, and the
value being a dictionary with key being the interface index as a string,
need to typecast the host_interfaces interface index as a string.
  • Loading branch information
sanmalho-git committed Dec 23, 2020
1 parent bf8512a commit be22df7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ansible/roles/vm_set/library/vm_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,12 +644,12 @@ def add_host_ports(self):
self.add_veth_if_to_docker(muxy_if, ptf_if)

# create muxy cable
upper_tor_if = self.duts_fp_ports[self.duts_name[intf[0][0]]][intf[0][1]]
lower_tor_if = self.duts_fp_ports[self.duts_name[intf[1][0]]][intf[1][1]]
upper_tor_if = self.duts_fp_ports[self.duts_name[intf[0][0]]][str(intf[0][1])]
lower_tor_if = self.duts_fp_ports[self.duts_name[intf[1][0]]][str(intf[1][1])]
self.create_muxy_cable(host_ifindex, muxy_if, upper_tor_if, lower_tor_if)
else:
host_ifindex = intf[2] if len(intf) == 3 else i
fp_port = self.duts_fp_ports[self.duts_name[intf[0]]][intf[1]]
fp_port = self.duts_fp_ports[self.duts_name[intf[0]]][str(intf[1])]
ptf_if = PTF_FP_IFACE_TEMPLATE % host_ifindex
self.add_dut_if_to_docker(ptf_if, fp_port)
else:
Expand All @@ -673,7 +673,7 @@ def remove_host_ports(self):
else:
host_ifindex = intf[2] if len(intf) == 3 else i
self.remove_muxy_cable(host_ifindex)
fp_port = self.duts_fp_ports[self.duts_name[intf[0]]][intf[1]]
fp_port = self.duts_fp_ports[self.duts_name[intf[0]]][str(intf[1])]
ptf_if = PTF_FP_IFACE_TEMPLATE % host_ifindex
self.remove_dut_if_from_docker(ptf_if, fp_port)
else:
Expand Down

0 comments on commit be22df7

Please sign in to comment.