From 0165d7bdffb212d3c05cd157b27103687ae42287 Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Thu, 9 Apr 2015 23:19:40 -0700 Subject: [PATCH] Implement Switch.stop(), which doesn't call terminate When I changed the switch implementations to call super().stop(), I neglected to include a Switch.stop() method which didn't call terminate(). This broke switch s1 stop and s1.stop(). Fixes #497 --- mininet/node.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mininet/node.py b/mininet/node.py index 076396c..872c061 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -901,6 +901,12 @@ class Switch( Node ): debug( 'Assuming', repr( self ), 'is connected to a controller\n' ) return True + def stop( self, deleteIntfs=True ): + """Stop switch + deleteIntfs: delete interfaces? (True)""" + if deleteIntfs: + self.deleteIntfs() + def __repr__( self ): "More informative string representation" intfs = ( ','.join( [ '%s:%s' % ( i.name, i.IP() )