Skip to content

Commit 31eb717

Browse files
authored
[vm_topology]: delete existing vm injected interface if exists (#2486)
Fix #2467 Signed-off-by: Guohan Lu <[email protected]>
1 parent 262246c commit 31eb717

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ansible/roles/vm_set/library/vm_topology.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,11 @@ def add_veth_if_to_docker(self, ext_if, int_if):
377377

378378
t_int_if = hashlib.md5((PTF_NAME_TEMPLATE % self.vm_set_name).encode("utf-8")).hexdigest()[0:6] + int_if + '_t'
379379

380+
if t_int_if in self.host_ifaces:
381+
VMTopology.cmd("ip link del dev %s" % t_int_if)
382+
383+
self.update()
384+
380385
if ext_if not in self.host_ifaces:
381386
VMTopology.cmd("ip link add %s type veth peer name %s" % (ext_if, t_int_if))
382387

0 commit comments

Comments
 (0)