print -> info; end the horror of print vs. print()
Although we could use print() from __future__, this messes up scripts which use examples as modules. The simple, if not nicest for 2.7, solution is to use info(), output() and other mininet.log functions. The disadvantage is that we may have to adjust things if we change info() to add automatic newlines, but we can burn that bridge in Mininet 3.x.
This commit is contained in:
1 parent
1eb6f65e40
commit
ee15ce2243
18 files changed
+128
-132
No files matched your search
@@ -15,7 +15,7 @@ from mininet.net import Mininet
|
||||
from mininet.node import CPULimitedHost
|
||||
from mininet.link import TCLink
|
||||
from mininet.util import dumpNodeConnections
|
||||
from mininet.log import setLogLevel
|
||||
from mininet.log import setLogLevel, info
|
||||
|
||||
from sys import argv
|
||||
|
||||
@@ -45,9 +45,9 @@ def perfTest( lossy=True ):
|
||||
host=CPULimitedHost, link=TCLink,
|
||||
autoStaticArp=True )
|
||||
net.start()
|
||||
print( "Dumping host connections" )
|
||||
info( "Dumping host connections\n" )
|
||||
dumpNodeConnections(net.hosts)
|
||||
print( "Testing bandwidth between h1 and h4" )
|
||||
info( "Testing bandwidth between h1 and h4\n" )
|
||||
h1, h4 = net.getNodeByName('h1', 'h4')
|
||||
net.iperf( ( h1, h4 ), l4Type='UDP' )
|
||||
net.stop()
|
||||
|
||||
Reference in new issue
Block a user