From 1095628b8a37cef80c13b3b5f0f465ee186edb5a Mon Sep 17 00:00:00 2001 From: Brandon Heller <brandonh@stanford.edu> Date: Fri, 18 Dec 2009 15:51:30 -0800 Subject: [PATCH] Clean up display Don't print retry errors by default. --- mininet/mininet.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mininet/mininet.py b/mininet/mininet.py index 7d4ac4be..89b256ad 100755 --- a/mininet/mininet.py +++ b/mininet/mininet.py @@ -344,14 +344,15 @@ def makeIntfPair( intf1, intf2 ): cmd = 'ip link add name ' + intf1 + ' type veth peer name ' + intf2 return checkRun( cmd ) -def moveIntf( intf, node ): +def moveIntf( intf, node, print_error = False ): "Move intf to node." cmd = 'ip link set ' + intf + ' netns ' + `node.pid` quietRun( cmd ) links = node.cmd( 'ip link show' ) if not intf in links: - print "*** Error: moveIntf:", intf, "not successfully moved to", - print node.name,":" + if print_error: + print "*** Error: moveIntf:", intf, "not successfully moved to", + print node.name,":" return False return True @@ -360,10 +361,9 @@ def retry( n, retry_delay, fn, *args): tries = 0 while not apply( fn, args ) and tries < n: sleep( retry_delay ) - print "*** retrying..."; flush() tries += 1 if tries >= n: - print "*** giving up" + print "*** gave up after %i retries" % tries; flush() exit( 1 ) def createLink( node1, node2 ): -- GitLab