Workaround for openvswitch_mod rename and pass code check.
This commit is contained in:
@@ -18,7 +18,7 @@ import time
|
|||||||
|
|
||||||
from mininet.clean import cleanup
|
from mininet.clean import cleanup
|
||||||
from mininet.cli import CLI
|
from mininet.cli import CLI
|
||||||
from mininet.log import lg, LEVELS, info, warn
|
from mininet.log import lg, LEVELS, info
|
||||||
from mininet.net import Mininet, MininetWithControlNet, VERSION
|
from mininet.net import Mininet, MininetWithControlNet, VERSION
|
||||||
from mininet.node import ( Host, CPULimitedHost, Controller, OVSController,
|
from mininet.node import ( Host, CPULimitedHost, Controller, OVSController,
|
||||||
NOX, RemoteController, UserSwitch, OVSKernelSwitch,
|
NOX, RemoteController, UserSwitch, OVSKernelSwitch,
|
||||||
@@ -26,7 +26,7 @@ from mininet.node import ( Host, CPULimitedHost, Controller, OVSController,
|
|||||||
from mininet.link import Link, TCLink
|
from mininet.link import Link, TCLink
|
||||||
from mininet.topo import SingleSwitchTopo, LinearTopo, SingleSwitchReversedTopo
|
from mininet.topo import SingleSwitchTopo, LinearTopo, SingleSwitchReversedTopo
|
||||||
from mininet.topolib import TreeTopo
|
from mininet.topolib import TreeTopo
|
||||||
from mininet.util import makeNumeric, custom, customConstructor, splitArgs
|
from mininet.util import custom, customConstructor
|
||||||
from mininet.util import buildTopo
|
from mininet.util import buildTopo
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ def modprobe( mod ):
|
|||||||
return quietRun( [ 'modprobe', mod ] )
|
return quietRun( [ 'modprobe', mod ] )
|
||||||
|
|
||||||
OF_KMOD = 'ofdatapath'
|
OF_KMOD = 'ofdatapath'
|
||||||
OVS_KMOD = 'openvswitch_mod'
|
OVS_KMOD = 'openvswitch_mod' # Renamed 'openvswitch' in OVS 1.7+/Linux 3.5+
|
||||||
TUN = 'tun'
|
TUN = 'tun'
|
||||||
|
|
||||||
def moduleDeps( subtract=None, add=None ):
|
def moduleDeps( subtract=None, add=None ):
|
||||||
|
|||||||
+5
-3
@@ -896,7 +896,9 @@ class OVSSwitch( Switch ):
|
|||||||
"Make sure Open vSwitch is installed and working"
|
"Make sure Open vSwitch is installed and working"
|
||||||
pathCheck( 'ovs-vsctl',
|
pathCheck( 'ovs-vsctl',
|
||||||
moduleName='Open vSwitch (openvswitch.org)')
|
moduleName='Open vSwitch (openvswitch.org)')
|
||||||
moduleDeps( subtract=OF_KMOD, add=OVS_KMOD )
|
# This should no longer be needed, and it breaks
|
||||||
|
# with OVS 1.7 which has renamed the kernel module:
|
||||||
|
# moduleDeps( subtract=OF_KMOD, add=OVS_KMOD )
|
||||||
out, err, exitcode = errRun( 'ovs-vsctl -t 1 show' )
|
out, err, exitcode = errRun( 'ovs-vsctl -t 1 show' )
|
||||||
if exitcode:
|
if exitcode:
|
||||||
error( out + err +
|
error( out + err +
|
||||||
@@ -985,10 +987,10 @@ class Controller( Node ):
|
|||||||
if 'Unable' not in listening:
|
if 'Unable' not in listening:
|
||||||
servers = self.cmd( 'netstat -atp' ).split( '\n' )
|
servers = self.cmd( 'netstat -atp' ).split( '\n' )
|
||||||
pstr = ':%d ' % self.port
|
pstr = ':%d ' % self.port
|
||||||
info = servers[ 0:1 ] + [ s for s in servers if pstr in s ]
|
clist = servers[ 0:1 ] + [ s for s in servers if pstr in s ]
|
||||||
raise Exception( "Please shut down the controller which is"
|
raise Exception( "Please shut down the controller which is"
|
||||||
" running on port %d:\n" % self.port +
|
" running on port %d:\n" % self.port +
|
||||||
'\n'.join( info ) )
|
'\n'.join( clist ) )
|
||||||
|
|
||||||
def start( self ):
|
def start( self ):
|
||||||
"""Start <controller> <args> on controller.
|
"""Start <controller> <args> on controller.
|
||||||
|
|||||||
+1
-3
@@ -1,6 +1,6 @@
|
|||||||
"Utility functions for Mininet."
|
"Utility functions for Mininet."
|
||||||
|
|
||||||
from mininet.log import output, info, error
|
from mininet.log import output, info, error, warn
|
||||||
|
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from resource import setrlimit, RLIMIT_NPROC, RLIMIT_NOFILE
|
from resource import setrlimit, RLIMIT_NPROC, RLIMIT_NOFILE
|
||||||
@@ -419,7 +419,6 @@ def splitArgs( argstr ):
|
|||||||
|
|
||||||
def customConstructor( constructors, argStr ):
|
def customConstructor( constructors, argStr ):
|
||||||
"""Return custom constructor based on argStr
|
"""Return custom constructor based on argStr
|
||||||
|
|
||||||
The args and key/val pairs in argsStr will be automatically applied
|
The args and key/val pairs in argsStr will be automatically applied
|
||||||
when the generated constructor is later used.
|
when the generated constructor is later used.
|
||||||
"""
|
"""
|
||||||
@@ -444,7 +443,6 @@ def customConstructor( constructors, argStr ):
|
|||||||
|
|
||||||
def buildTopo( topos, topoStr ):
|
def buildTopo( topos, topoStr ):
|
||||||
"""Create topology from string with format (object, arg1, arg2,...).
|
"""Create topology from string with format (object, arg1, arg2,...).
|
||||||
|
|
||||||
input topos is a dict of topo names to constructors, possibly w/args.
|
input topos is a dict of topo names to constructors, possibly w/args.
|
||||||
"""
|
"""
|
||||||
topo, args, kwargs = splitArgs( topoStr )
|
topo, args, kwargs = splitArgs( topoStr )
|
||||||
|
|||||||
Reference in New Issue
Block a user