Use print function

This commit is contained in:
Brad Walker
2016-06-21 16:27:04 -07:00
committed by Bob Lantz
parent 57abd9baef
commit 70fcc45893
25 changed files with 189 additions and 141 deletions
+13 -11
View File
@@ -74,6 +74,8 @@ Things to do:
- hifi support (e.g. delay compensation)
"""
from __future__ import print_function
from mininet.node import Node, Host, OVSSwitch, Controller
from mininet.link import Link, Intf
from mininet.net import Mininet
@@ -238,7 +240,7 @@ class RemoteMixin( object ):
args: string or list of strings
returns: stdout and stderr"""
popen = self.rpopen( *cmd, **opts )
# print 'RCMD: POPEN:', popen
# print( 'RCMD: POPEN:', popen )
# These loops are tricky to get right.
# Once the process exits, we can read
# EOF twice if necessary.
@@ -792,28 +794,28 @@ def testNsTunnels():
def testRemoteNet( remote='ubuntu2' ):
"Test remote Node classes"
print '*** Remote Node Test'
print( '*** Remote Node Test' )
net = Mininet( host=RemoteHost, switch=RemoteOVSSwitch,
link=RemoteLink )
c0 = net.addController( 'c0' )
# Make sure controller knows its non-loopback address
Intf( 'eth0', node=c0 ).updateIP()
print "*** Creating local h1"
print( "*** Creating local h1" )
h1 = net.addHost( 'h1' )
print "*** Creating remote h2"
print( "*** Creating remote h2" )
h2 = net.addHost( 'h2', server=remote )
print "*** Creating local s1"
print( "*** Creating local s1" )
s1 = net.addSwitch( 's1' )
print "*** Creating remote s2"
print( "*** Creating remote s2" )
s2 = net.addSwitch( 's2', server=remote )
print "*** Adding links"
print( "*** Adding links" )
net.addLink( h1, s1 )
net.addLink( s1, s2 )
net.addLink( h2, s2 )
net.start()
print 'Mininet is running on', quietRun( 'hostname' ).strip()
print( 'Mininet is running on', quietRun( 'hostname' ).strip() )
for node in c0, h1, h2, s1, s2:
print 'Node', node, 'is running on', node.cmd( 'hostname' ).strip()
print( 'Node', node, 'is running on', node.cmd( 'hostname' ).strip() )
net.pingAll()
CLI( net )
net.stop()
@@ -900,9 +902,9 @@ def signalTest():
h.shell.send_signal( SIGINT )
h.shell.poll()
if h.shell.returncode is None:
print 'OK: ', h, 'has not exited'
print( 'OK: ', h, 'has not exited' )
else:
print 'FAILURE:', h, 'exited with code', h.shell.returncode
print( 'FAILURE:', h, 'exited with code', h.shell.returncode )
h.stop()
if __name__ == '__main__':