Skip to content
Snippets Groups Projects
Commit 74a56e2b authored by Bob Lantz's avatar Bob Lantz
Browse files

Pass code check.

parent 444f9d8d
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,7 @@ def addHost( net, N ): ...@@ -20,6 +20,7 @@ def addHost( net, N ):
return net.addHost( name, ip=ip ) return net.addHost( name, ip=ip )
def multiControllerNet(): def multiControllerNet():
"Create a network with multiple controllers."
net = Mininet( controller=Controller, switch=Switch) net = Mininet( controller=Controller, switch=Switch)
...@@ -36,13 +37,16 @@ def multiControllerNet(): ...@@ -36,13 +37,16 @@ def multiControllerNet():
hosts2 = [ addHost( net, n ) for n in 5, 6 ] hosts2 = [ addHost( net, n ) for n in 5, 6 ]
print "*** Creating links" print "*** Creating links"
[ s1.linkTo( h ) for h in hosts1 ] for h in hosts1:
[ s2.linkTo( h ) for h in hosts2 ] s1.linkTo( h )
for h in hosts2:
s2.linkTo( h )
s1.linkTo( s2 ) s1.linkTo( s2 )
print "*** Starting network" print "*** Starting network"
net.build() net.build()
[ controller.start() for controller in c1, c2 ] c1.start()
c2.start()
s1.start( [ c1 ] ) s1.start( [ c1 ] )
s2.start( [ c2 ] ) s2.start( [ c2 ] )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment