node: verify telnet installation for controller checking

Reported-by: Julius Bachnick

https://mailman.stanford.edu/pipermail/mininet-discuss/2012-November/001349.html
This commit is contained in:
Brandon Heller
2012-11-26 15:22:07 -08:00
parent 1e9b5f61fc
commit b453e0068f
+6
View File
@@ -995,6 +995,12 @@ class Controller( Node ):
def checkListening( self ):
"Make sure no controllers are running on our port"
# Verify that Telnet is installed first:
out, err, returnCode = errRun( "which telnet" )
if 'telnet' not in out or returnCode != 0:
raise Exception( "Error running telnet to check for listening "
"controllers; please check that it is "
"installed." )
listening = self.cmd( "echo A | telnet -e A %s %d" %
( self.ip, self.port ) )
if 'Unable' not in listening: