Move init() into Mininet() and remove calls (since called automatically.)
Note: we should probably rename it "setup()" to avoid confusion.
This commit is contained in:
@@ -26,7 +26,7 @@ of switches, this example demonstrates:
|
||||
import sys
|
||||
flush = sys.stdout.flush
|
||||
|
||||
from mininet.net import init, Mininet
|
||||
from mininet.net import Mininet
|
||||
# from mininet.node import KernelSwitch
|
||||
from mininet.node import UserSwitch, OVSKernelSwitch
|
||||
from mininet.topo import Topo, Node
|
||||
@@ -106,7 +106,6 @@ def linearBandwidthTest( lengths ):
|
||||
|
||||
if __name__ == '__main__':
|
||||
lg.setLogLevel( 'info' )
|
||||
init()
|
||||
sizes = [ 1, 10, 20, 40, 60, 80, 100 ]
|
||||
print "*** Running linearBandwidthTest", sizes
|
||||
linearBandwidthTest( sizes )
|
||||
|
||||
@@ -8,13 +8,13 @@ but it exposes the configuration details and allows customization.
|
||||
For most tasks, the higher-level API will be preferable.
|
||||
"""
|
||||
|
||||
from mininet.net import init
|
||||
from mininet.node import Node, OVSKernelSwitch
|
||||
from mininet.net import Mininet
|
||||
from mininet.node import Node
|
||||
from mininet.util import createLink
|
||||
from mininet.log import setLogLevel, info
|
||||
|
||||
def scratchNet( cname='controller', cargs='ptcp:' ):
|
||||
"Create network from scratch using kernel switch."
|
||||
"Create network from scratch using Open vSwitch."
|
||||
|
||||
info( "*** Creating nodes\n" )
|
||||
controller = Node( 'c0', inNamespace=False )
|
||||
@@ -53,6 +53,5 @@ def scratchNet( cname='controller', cargs='ptcp:' ):
|
||||
if __name__ == '__main__':
|
||||
setLogLevel( 'info' )
|
||||
info( '*** Scratch network demo (kernel datapath)\n' )
|
||||
OVSKernelSwitch.setup()
|
||||
init()
|
||||
Mininet.init()
|
||||
scratchNet()
|
||||
|
||||
@@ -10,7 +10,7 @@ For most tasks, the higher-level API will be preferable.
|
||||
This version uses the user datapath and an explicit control network.
|
||||
"""
|
||||
|
||||
from mininet.net import init
|
||||
from mininet.net import Mininet
|
||||
from mininet.node import Node
|
||||
from mininet.util import createLink
|
||||
from mininet.log import setLogLevel, info
|
||||
@@ -64,5 +64,5 @@ def scratchNetUser( cname='controller', cargs='ptcp:' ):
|
||||
if __name__ == '__main__':
|
||||
setLogLevel( 'info' )
|
||||
info( '*** Scratch network demo (user datapath)\n' )
|
||||
init()
|
||||
Mininet.init()
|
||||
scratchNetUser()
|
||||
|
||||
Reference in New Issue
Block a user