Change from numeric to symbolic pylint error codes
This commit is contained in:
+5
-10
@@ -93,11 +93,6 @@ class CLI( Cmd ):
|
||||
self.locals.update( self.mn )
|
||||
return self.locals
|
||||
|
||||
# Disable pylint "Unused argument: 'arg's'" messages, as well as
|
||||
# "method could be a function" warning, since each CLI function
|
||||
# must have the same interface
|
||||
# pylint: disable=R0201
|
||||
|
||||
helpStr = (
|
||||
'You may also send a command to a node using:\n'
|
||||
' <node> command {args}\n'
|
||||
@@ -139,10 +134,11 @@ class CLI( Cmd ):
|
||||
def do_sh( self, line ):
|
||||
"""Run an external shell command
|
||||
Usage: sh [cmd args]"""
|
||||
assert self # satisfy pylint and allow override
|
||||
call( line, shell=True )
|
||||
|
||||
# do_py() and do_px() need to catch any exception during eval()/exec()
|
||||
# pylint: disable=W0703
|
||||
# pylint: disable=broad-except
|
||||
|
||||
def do_py( self, line ):
|
||||
"""Evaluate a Python expression.
|
||||
@@ -159,7 +155,7 @@ class CLI( Cmd ):
|
||||
output( str( e ) + '\n' )
|
||||
|
||||
# We are in fact using the exec() pseudo-function
|
||||
# pylint: disable=W0122
|
||||
# pylint: disable=exec-used
|
||||
|
||||
def do_px( self, line ):
|
||||
"""Execute a Python statement.
|
||||
@@ -169,7 +165,7 @@ class CLI( Cmd ):
|
||||
except Exception, e:
|
||||
output( str( e ) + '\n' )
|
||||
|
||||
# pylint: enable=W0703,W0122
|
||||
# pylint: enable=broad-except,exec-used
|
||||
|
||||
def do_pingall( self, line ):
|
||||
"Ping between all hosts."
|
||||
@@ -284,6 +280,7 @@ class CLI( Cmd ):
|
||||
|
||||
def do_exit( self, _line ):
|
||||
"Exit"
|
||||
assert self # satisfy pylint and allow override
|
||||
return 'exited by user command'
|
||||
|
||||
def do_quit( self, line ):
|
||||
@@ -398,8 +395,6 @@ class CLI( Cmd ):
|
||||
else:
|
||||
error( '*** Unknown command: %s\n' % line )
|
||||
|
||||
# pylint: enable=R0201
|
||||
|
||||
def waitForNode( self, node ):
|
||||
"Wait for a node to finish, and print its output."
|
||||
# Pollers
|
||||
|
||||
+3
-3
@@ -124,8 +124,8 @@ class MininetLogger( Logger, object ):
|
||||
self.setLevel( level )
|
||||
self.handlers[ 0 ].setLevel( level )
|
||||
|
||||
# pylint: disable=E0202
|
||||
# "An attribute inherited from mininet.log hide this method"
|
||||
# pylint: disable=method-hidden
|
||||
# "An attribute inherited from mininet.log hide this method" (sic)
|
||||
# Not sure why this is occurring - this function definitely gets called.
|
||||
|
||||
# See /usr/lib/python2.5/logging/__init__.py; modified from warning()
|
||||
@@ -142,7 +142,7 @@ class MininetLogger( Logger, object ):
|
||||
if self.isEnabledFor( OUTPUT ):
|
||||
self._log( OUTPUT, msg, args, kwargs )
|
||||
|
||||
# pylint: enable=E0202
|
||||
# pylint: enable=method-hidden
|
||||
|
||||
lg = MininetLogger()
|
||||
|
||||
|
||||
+2
-2
@@ -254,9 +254,9 @@ class Mininet( object ):
|
||||
if isinstance( name, Controller ):
|
||||
controller_new = name
|
||||
# Pylint thinks controller is a str()
|
||||
# pylint: disable=E1103
|
||||
# pylint: disable=maybe-no-member
|
||||
name = controller_new.name
|
||||
# pylint: enable=E1103
|
||||
# pylint: enable=maybe-no-member
|
||||
else:
|
||||
controller_new = controller( name, **params )
|
||||
# Add new controller to net
|
||||
|
||||
+2
-2
@@ -289,7 +289,7 @@ class Topo( object ):
|
||||
|
||||
|
||||
# Our idiom defines additional parameters in build(param...)
|
||||
# pylint: disable=arguments-differ, attribute-defined-outside-init
|
||||
# pylint: disable=arguments-differ
|
||||
|
||||
class SingleSwitchTopo( Topo ):
|
||||
"Single switch connected to k hosts."
|
||||
@@ -345,4 +345,4 @@ class LinearTopo( Topo ):
|
||||
self.addLink( switch, lastSwitch )
|
||||
lastSwitch = switch
|
||||
|
||||
# pylint: enable=arguments-differ, attribute-defined-outside-init
|
||||
# pylint: enable=arguments-differ
|
||||
|
||||
+3
-3
@@ -3,8 +3,8 @@
|
||||
from mininet.topo import Topo
|
||||
from mininet.net import Mininet
|
||||
|
||||
# The build() method is expected to do both of these things:
|
||||
# pylint: disable=attribute-defined-outside-init, arguments-differ
|
||||
# The build() method is expected to do this:
|
||||
# pylint: disable=arguments-differ
|
||||
|
||||
class TreeTopo( Topo ):
|
||||
"Topology for a tree network with a given depth and fanout."
|
||||
@@ -69,4 +69,4 @@ class TorusTopo( Topo ):
|
||||
self.addLink( sw1, sw2 )
|
||||
self.addLink( sw1, sw3 )
|
||||
|
||||
# pylint: enable=attribute-defined-outside-init, arguments-differ
|
||||
# pylint: enable=arguments-differ
|
||||
|
||||
+4
-5
@@ -25,7 +25,7 @@ def checkRun( cmd ):
|
||||
return check_call( cmd.split( ' ' ) )
|
||||
|
||||
# pylint doesn't understand explicit type checking
|
||||
# pylint: disable=E1103
|
||||
# pylint: disable=maybe-no-member
|
||||
|
||||
def oldQuietRun( *cmd ):
|
||||
"""Run a command, routing stderr to stdout, and return the output.
|
||||
@@ -119,8 +119,7 @@ def quietRun( cmd, **kwargs ):
|
||||
"Run a command and return merged stdout and stderr"
|
||||
return errRun( cmd, stderr=STDOUT, **kwargs )[ 0 ]
|
||||
|
||||
# pylint: enable=E1103
|
||||
# pylint: disable=E1101
|
||||
# pylint: enable=maybe-no-member
|
||||
|
||||
def isShellBuiltin( cmd ):
|
||||
"Return True if cmd is a bash builtin."
|
||||
@@ -133,8 +132,6 @@ def isShellBuiltin( cmd ):
|
||||
|
||||
isShellBuiltin.builtIns = None
|
||||
|
||||
# pylint: enable=E1101
|
||||
|
||||
# Interface management
|
||||
#
|
||||
# Interfaces are managed as strings which are simply the
|
||||
@@ -431,6 +428,8 @@ def fixLimits():
|
||||
except Exception:
|
||||
warn( "*** Error setting resource limits. "
|
||||
"Mininet's performance may be affected.\n" )
|
||||
# pylint: enable=broad-except
|
||||
|
||||
|
||||
def mountCgroups():
|
||||
"Make sure cgroups file system is mounted"
|
||||
|
||||
Reference in New Issue
Block a user