Revision 05cce994

View differences:

mininet.py
357 357
def retry( n, fn, *args):
358 358
   "Try something N times before giving up."
359 359
   tries = 0
360
   while not apply( fn, args ) and tries < 3:
360
   while not apply( fn, args ) and tries < n:
361 361
      sleep( 1 )
362 362
      print "*** retrying..."; flush()
363 363
      tries += 1
364
   if tries > 3: exit( 1 )
364
   if tries >= n: exit( 1 )
365 365
   
366 366
def createLink( node1, node2 ):
367 367
   "Create a link node1-intf1 <---> node2-intf2."

Also available in: Unified diff