Use output()/error() instead of print

We shouldn't be using print in the core API, with
the possible (?) exception of error/abort messages.
This commit is contained in:
Bob Lantz
2016-08-08 15:32:31 -07:00
parent 8ac077a721
commit f89a5bcf70
+2 -2
View File
@@ -373,7 +373,7 @@ class CLI( Cmd ):
def do_links( self, _line ): def do_links( self, _line ):
"Report on links" "Report on links"
for link in self.mn.links: for link in self.mn.links:
print( link, link.status() ) output( link, link.status() )
def do_switch( self, line ): def do_switch( self, line ):
"Starts or stops a switch" "Starts or stops a switch"
@@ -407,7 +407,7 @@ class CLI( Cmd ):
if first in self.mn: if first in self.mn:
if not args: if not args:
print( "*** Enter a command for node: %s <cmd>" % first ) error( "*** Enter a command for node: %s <cmd>" % first )
return return
node = self.mn[ first ] node = self.mn[ first ]
rest = args.split( ' ' ) rest = args.split( ' ' )