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
This commit is contained in:
Bob Lantz
2015-04-09 23:19:40 -07:00
parent 1df1f9a1c5
commit 0165d7bdff
+6
View File
@@ -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() )