Fix some pylint messages.
This commit is contained in:
+1
-1
@@ -55,7 +55,7 @@ def cleanup():
|
||||
sh( 'ovs-vsctl del-br ' + dp )
|
||||
|
||||
info( "*** Removing all links of the pattern foo-ethX\n" )
|
||||
links = sh( "ip link show | egrep -o '(\w+-eth\w+)'" ).split( '\n' )
|
||||
links = sh( r"ip link show | egrep -o '(\w+-eth\w+)'" ).split( '\n' )
|
||||
for link in links:
|
||||
if link != '':
|
||||
sh( "ip link del " + link )
|
||||
|
||||
+8
-10
@@ -60,18 +60,16 @@ class Singleton( type ):
|
||||
See http://en.wikipedia.org/wiki/SingletonPattern#Python
|
||||
|
||||
Intended to be used as a __metaclass_ param, as shown for the class
|
||||
below.
|
||||
below."""
|
||||
|
||||
Changed cls first args to mcs to satisfy pylint."""
|
||||
def __init__( cls, name, bases, dict_ ):
|
||||
super( Singleton, cls ).__init__( name, bases, dict_ )
|
||||
cls.instance = None
|
||||
|
||||
def __init__( mcs, name, bases, dict_ ):
|
||||
super( Singleton, mcs ).__init__( name, bases, dict_ )
|
||||
mcs.instance = None
|
||||
|
||||
def __call__( mcs, *args, **kw ):
|
||||
if mcs.instance is None:
|
||||
mcs.instance = super( Singleton, mcs ).__call__( *args, **kw )
|
||||
return mcs.instance
|
||||
def __call__( cls, *args, **kw ):
|
||||
if cls.instance is None:
|
||||
cls.instance = super( Singleton, cls ).__call__( *args, **kw )
|
||||
return cls.instance
|
||||
|
||||
|
||||
class MininetLogger( Logger, object ):
|
||||
|
||||
+2
-2
@@ -759,7 +759,7 @@ class Switch( Node ):
|
||||
def defaultDpid( self ):
|
||||
"Derive dpid from switch name, s1 -> 1"
|
||||
try:
|
||||
dpid = int( re.findall( '\d+', self.name )[ 0 ] )
|
||||
dpid = int( re.findall( r'\d+', self.name )[ 0 ] )
|
||||
dpid = hex( dpid )[ 2: ]
|
||||
dpid = '0' * ( self.dpidLen - len( dpid ) ) + dpid
|
||||
return dpid
|
||||
@@ -787,7 +787,7 @@ class Switch( Node ):
|
||||
|
||||
def connected( self ):
|
||||
"Is the switch connected to a controller? (override this method)"
|
||||
return False
|
||||
return False and self # satisfy pylint
|
||||
|
||||
def __repr__( self ):
|
||||
"More informative string representation"
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ def makeTerm( node, title='Node', term='xterm', display=None ):
|
||||
|
||||
def runX11( node, cmd ):
|
||||
"Run an X11 client on a node"
|
||||
display, tunnel = tunnelX11( node )
|
||||
_display, tunnel = tunnelX11( node )
|
||||
popen = node.popen( cmd )
|
||||
return [ tunnel, popen ]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user