Skip to content

Commit

Permalink
[vm_topology]: delete existing vm injected interface if exists (#2486)
Browse files Browse the repository at this point in the history
Fix #2467

Signed-off-by: Guohan Lu <lguohan@gmail.com>
  • Loading branch information
lguohan authored Nov 8, 2020
1 parent 262246c commit 31eb717
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ansible/roles/vm_set/library/vm_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ def add_veth_if_to_docker(self, ext_if, int_if):

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

if t_int_if in self.host_ifaces:
VMTopology.cmd("ip link del dev %s" % t_int_if)

self.update()

if ext_if not in self.host_ifaces:
VMTopology.cmd("ip link add %s type veth peer name %s" % (ext_if, t_int_if))

Expand Down

0 comments on commit 31eb717

Please sign in to comment.