daemon: Wait longer for EMANE network interfaces to exist.

When EMANE is still running.
This commit is contained in:
Tom Goff 2016-10-12 17:37:27 +00:00
parent 6d1b5d28a1
commit b1beff1eba
2 changed files with 29 additions and 1 deletions

View file

@ -116,7 +116,19 @@ class TunTap(PyCoreNetIf):
def nodedevexists():
cmd = (IP_BIN, 'link', 'show', self.name)
return self.node.cmd(cmd)
self.waitfor(nodedevexists)
count = 0
while True:
try:
self.waitfor(nodedevexists)
break
except RuntimeError:
# check if this is an EMANE interface; if so, continue
# waiting if EMANE is still running
if count < 5 and isinstance(self.net, EmaneNode) and \
self.node.session.emane.emanerunning(self.node):
count += 1
else:
raise
def install(self):
''' Install this TAP into its namespace. This is not done from the