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
+3 -2
View File
@@ -25,6 +25,7 @@ list all nodes ('nodes'), to print out the network topology
and bandwidth ('iperf'.)
"""
from __future__ import print_function
from subprocess import call
from cmd import Cmd
from os import isatty
@@ -371,7 +372,7 @@ class CLI( Cmd ):
def do_links( self, _line ):
"Report on links"
for link in self.mn.links:
print link, link.status()
print( link, link.status() )
def do_switch( self, line ):
"Starts or stops a switch"
@@ -405,7 +406,7 @@ class CLI( Cmd ):
if first in self.mn:
if not args:
print "*** Enter a command for node: %s <cmd>" % first
print( "*** Enter a command for node: %s <cmd>" % first )
return
node = self.mn[ first ]
rest = args.split( ' ' )
+3 -1
View File
@@ -1,5 +1,7 @@
"Utility functions for Mininet."
from __future__ import print_function
from mininet.log import output, info, error, warn, debug
from time import sleep
@@ -587,7 +589,7 @@ def ensureRoot():
Probably we should only sudo when needed as per Big Switch's patch.
"""
if os.getuid() != 0:
print "*** Mininet must run as root."
print( "*** Mininet must run as root." )
exit( 1 )
return