From b2ef87ae5138b24093f4f86178b001105560c0e5 Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Wed, 24 Mar 2010 15:02:28 -0700 Subject: [PATCH] Changes to pass code check. We should check NOXController and RemoteController to make sure that they are not broken, but I cannot do this at the moment. --- .pylint | 2 +- bin/mn | 2 +- mininet/cli.py | 10 +++++----- mininet/node.py | 11 ++++++----- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.pylint b/.pylint index cd025e1..4c4b48b 100644 --- a/.pylint +++ b/.pylint @@ -53,7 +53,7 @@ disable-msg-cat=IR #enable-msg= # Disable the message(s) with the given id(s). -disable-msg=W0704,C0103,W0231,E1102,W0511,W0142 +disable-msg=W0704,C0103,W0231,E1102,W0511,W0142,R0902,R0903,R0904,R0913,R0914,R0801 [REPORTS] diff --git a/bin/mn b/bin/mn index 497a02f..eb6a53a 100755 --- a/bin/mn +++ b/bin/mn @@ -65,7 +65,7 @@ def buildTopo( topo ): topo_seq_params = [ s for s in topo_params if '=' not in s ] topo_seq_params = [ makeNumeric( s ) for s in topo_seq_params ] topo_kw_params = {} - for s in [ s for s in topo_params if '=' in s ]: + for s in [ p for p in topo_params if '=' in p ]: key, val = s.split( '=' ) topo_kw_params[ key ] = makeNumeric( val ) diff --git a/mininet/cli.py b/mininet/cli.py index 292011d..0e77f28 100644 --- a/mininet/cli.py +++ b/mininet/cli.py @@ -59,9 +59,10 @@ class CLI( Cmd ): "Don't repeat last command when you hit return." pass - # Disable pylint "Unused argument: 'arg's'" messages. - # Each CLI function needs the same interface. - # pylint: disable-msg=W0613 + # 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-msg=W0613,R0201 def do_help( self, args ): "Describe available CLI commands." @@ -218,5 +219,4 @@ class CLI( Cmd ): else: self.stdout.write( '*** Unknown syntax: %s\n' % line ) - # Re-enable pylint "Unused argument: 'arg's'" messages. - # pylint: enable-msg=W0613 + # pylint: enable-msg=W0613,R0201 diff --git a/mininet/node.py b/mininet/node.py index cdc67e2..e2a23ac 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -422,7 +422,7 @@ class Switch( Node ): class UserSwitch( Switch ): "User-space switch." - def __init__( self, name, *args, **kwargs ): + def __init__( self, name, **kwargs ): """Init. name: name for the switch""" Switch.__init__( self, name, **kwargs ) @@ -658,7 +658,7 @@ class ControllerParams( object ): class NOX( Controller ): "Controller to run a NOX application." - def __init__( self, name, inNamespace=False, noxArgs=None, **kwargs ): + def __init__( self, name, noxArgs=None, **kwargs ): """Init. name: name to give controller noxArgs: list of args, or single arg, to pass to NOX""" @@ -681,14 +681,15 @@ class NOX( Controller ): class RemoteController( Controller ): "Controller running outside of Mininet's control." - def __init__( self, name, inNamespace=False, defaultIP='127.0.0.1', - port=6633 ): + def __init__( self, name, defaultIP='127.0.0.1', + port=6633, **kwargs): """Init. name: name to give controller defaultIP: the IP address where the remote controller is listening port: the port where the remote controller is listening""" - Controller.__init__( self, name, defaultIP=defaultIP, port=port ) + Controller.__init__( self, name, defaultIP=defaultIP, port=port, + **kwargs ) def start( self ): "Overridden to do nothing."