From b453e0068f76d47c241e9c088cc261461502262e Mon Sep 17 00:00:00 2001 From: Brandon Heller Date: Mon, 26 Nov 2012 15:18:43 -0800 Subject: [PATCH] node: verify telnet installation for controller checking Reported-by: Julius Bachnick https://mailman.stanford.edu/pipermail/mininet-discuss/2012-November/001349.html --- mininet/node.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mininet/node.py b/mininet/node.py index a065533..566e3df 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -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: