fixing controllers.py to use api

This commit is contained in:
Brian O'Connor
2013-09-11 12:00:14 -07:00
parent 3a35480c7a
commit aacf7c4613
+5 -3
View File
@@ -15,8 +15,8 @@ setLogLevel( 'info' )
# Two local and one "external" controller (which is actually c0) # Two local and one "external" controller (which is actually c0)
# Ignore the warning message that the remote isn't (yet) running # Ignore the warning message that the remote isn't (yet) running
c0 = Controller( 'c0' ) c0 = Controller( 'c0', port=6633 )
c1 = Controller( 'c1' ) c1 = Controller( 'c1', port=6634 )
c2 = RemoteController( 'c2', ip='127.0.0.1' ) c2 = RemoteController( 'c2', ip='127.0.0.1' )
cmap = { 's1': c0, 's2': c1, 's3': c2 } cmap = { 's1': c0, 's2': c1, 's3': c2 }
@@ -28,7 +28,9 @@ class MultiSwitch( OVSSwitch ):
topo = TreeTopo( depth=2, fanout=2 ) topo = TreeTopo( depth=2, fanout=2 )
net = Mininet( topo=topo, switch=MultiSwitch, build=False ) net = Mininet( topo=topo, switch=MultiSwitch, build=False )
net.controllers = [ c0, c1 ] for c in [ c0, c1 ]:
net.addController(c)
net.build() net.build()
net.start() net.start()
CLI( net ) CLI( net )