From 97a0cacef805b6ca63cabd018003d72a76a5c9fc Mon Sep 17 00:00:00 2001 From: Brenden Blanco Date: Thu, 18 May 2017 09:57:42 -0700 Subject: [PATCH] Workaround for possible race in pyroute2.ipdb In simulation.py, add a call to initdb() to force-refresh the netlink socket and the interface list. Signed-off-by: Brenden Blanco --- examples/networking/simulation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/networking/simulation.py b/examples/networking/simulation.py index aa9888dfac7f..2c6a0f3d6980 100644 --- a/examples/networking/simulation.py +++ b/examples/networking/simulation.py @@ -66,6 +66,7 @@ def _ns_add_ifc(self, name, ns_ifc, ifc_base_name=None, in_ifc=None, if out_ifc: out_ifc.up().commit() ns_ipdb.interfaces.lo.up().commit() + ns_ipdb.initdb() in_ifc = ns_ipdb.interfaces[in_ifname] with in_ifc as v: v.ifname = ns_ifc