diff --git a/examples/simpleperf.py b/examples/simpleperf.py index 76de0bd..3dad32c 100644 --- a/examples/simpleperf.py +++ b/examples/simpleperf.py @@ -19,10 +19,10 @@ class SingleSwitchTopo(Topo): for h in range(n): # Each host gets 50%/n of system CPU host = self.addHost('h%s' % (h + 1), - cpu=.5 / n) + cpu=.5 / n) # 10 Mbps, 5ms delay, 10% loss self.addLink(host, switch, - bw=10, delay='5ms', loss=10, use_htb=True) + bw=10, delay='5ms', loss=10, use_htb=True) def perfTest(): "Create network and run simple performance test" diff --git a/examples/treeping64.py b/examples/treeping64.py index 8385a33..ba60f1b 100755 --- a/examples/treeping64.py +++ b/examples/treeping64.py @@ -10,9 +10,9 @@ def treePing64(): "Run ping test on 64-node tree networks." results = {} - switches = { # 'reference kernel': KernelSwitch, - 'reference user': UserSwitch, - 'Open vSwitch kernel': OVSKernelSwitch } + switches = { # 'reference kernel': KernelSwitch, + 'reference user': UserSwitch, + 'Open vSwitch kernel': OVSKernelSwitch } for name in switches: print "*** Testing", name, "datapath" diff --git a/mininet/link.py b/mininet/link.py index 43cd207..21e18ba 100644 --- a/mininet/link.py +++ b/mininet/link.py @@ -246,11 +246,11 @@ class TCIntf( Intf ): '%s ' % jitter if jitter is not None else '', 'loss %d ' % loss if loss is not None else '', 'limit %d' % max_queue_size if max_queue_size is not None - else '' ) + else '' ) if netemargs: cmds = [ '%s qdisc add dev %s ' + parent + ' handle 10: netem ' + - netemargs ] + netemargs ] return cmds def tc( self, cmd, tc='tc' ): @@ -290,8 +290,8 @@ class TCIntf( Intf ): # Delay/jitter/loss/max_queue_size using netem cmds += self.delayCmds( delay=delay, jitter=jitter, loss=loss, - max_queue_size=max_queue_size, - parent=parent ) + max_queue_size=max_queue_size, + parent=parent ) # Ugly but functional: display configuration info stuff = ( ( [ '%.2fMbit' % bw ] if bw is not None else [] ) + diff --git a/mininet/net.py b/mininet/net.py index ccce862..6a091c3 100755 --- a/mininet/net.py +++ b/mininet/net.py @@ -423,7 +423,7 @@ class Mininet( object ): m = re.search( r, pingOutput ) if m is None: error( '*** Error: could not parse ping output: %s\n' % - pingOutput ) + pingOutput ) return (1, 0) sent, received = int( m.group( 1 ) ), int( m.group( 2 ) ) return sent, received diff --git a/mininet/node.py b/mininet/node.py index a8b7e30..add10f3 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -770,7 +770,7 @@ class Switch( Node ): return Node.sendCmd( self, *cmd, **kwargs ) else: error( '*** Error: %s has execed and cannot accept commands' % - self.name ) + self.name ) def __repr__( self ): "More informative string representation" @@ -1053,7 +1053,7 @@ class NOX( Controller ): Controller.__init__( self, name, command=noxCoreDir + '/nox_core', cargs='--libdir=/usr/local/lib -v -i ptcp:%s ' + - ' '.join( noxArgs ), + ' '.join( noxArgs ), cdir=noxCoreDir, **kwargs ) @@ -1084,4 +1084,4 @@ class RemoteController( Controller ): ( self.ip, self.port ) ) if 'Unable' in listening: warn( "Unable to contact the remote controller" - " at %s:%d\n" % ( self.ip, self.port ) ) + " at %s:%d\n" % ( self.ip, self.port ) ) diff --git a/mininet/topo.py b/mininet/topo.py index 27df013..fff9604 100644 --- a/mininet/topo.py +++ b/mininet/topo.py @@ -63,7 +63,7 @@ class Topo(object): return result def addLink(self, node1, node2, port1=None, port2=None, - **opts): + **opts): """node1, node2: nodes to link together port1, port2: ports (optional) opts: link options (optional) @@ -205,7 +205,7 @@ class SingleSwitchReversedTopo(Topo): for h in irange(1, k): host = self.addHost('h%s' % h) self.addLink(host, switch, - port1=0, port2=(k - h + 1)) + port1=0, port2=(k - h + 1)) class LinearTopo(Topo): "Linear topology of k switches, with one host per switch."