Split lines to make pylint happy
This commit is contained in:
@@ -6,7 +6,6 @@ Example to create a Mininet topology and connect it to the internet via NAT
|
|||||||
|
|
||||||
from mininet.cli import CLI
|
from mininet.cli import CLI
|
||||||
from mininet.log import lg
|
from mininet.log import lg
|
||||||
from mininet.node import Node
|
|
||||||
from mininet.topolib import TreeNet
|
from mininet.topolib import TreeNet
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
+2
-2
@@ -9,7 +9,6 @@ from mininet.log import info, warn
|
|||||||
from mininet.moduledeps import pathCheck
|
from mininet.moduledeps import pathCheck
|
||||||
from mininet.util import quietRun
|
from mininet.util import quietRun
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
class LinuxBridge( Switch ):
|
class LinuxBridge( Switch ):
|
||||||
"Linux Bridge (with optional spanning tree)"
|
"Linux Bridge (with optional spanning tree)"
|
||||||
@@ -138,7 +137,8 @@ class NAT( Node ):
|
|||||||
self.cmd( 'iptables -D FORWARD',
|
self.cmd( 'iptables -D FORWARD',
|
||||||
'-o', self.localIntf, '-d', self.subnet,'-j ACCEPT' )
|
'-o', self.localIntf, '-d', self.subnet,'-j ACCEPT' )
|
||||||
self.cmd( 'iptables -t nat -D POSTROUTING',
|
self.cmd( 'iptables -t nat -D POSTROUTING',
|
||||||
'-s', self.subnet, '\'!\'', '-d', self.subnet, '-j MASQUERADE' )
|
'-s', self.subnet, '\'!\'', '-d', self.subnet,
|
||||||
|
'-j MASQUERADE' )
|
||||||
# Put the forwarding state back to what it was
|
# Put the forwarding state back to what it was
|
||||||
self.cmd( 'sysctl net.ipv4.ip_forward=%s' % self.forwardState )
|
self.cmd( 'sysctl net.ipv4.ip_forward=%s' % self.forwardState )
|
||||||
super( NAT, self ).terminate()
|
super( NAT, self ).terminate()
|
||||||
|
|||||||
+2
-1
@@ -67,7 +67,8 @@ class TorusTopo( Topo ):
|
|||||||
switch = switches[ i, j ] = self.addSwitch(
|
switch = switches[ i, j ] = self.addSwitch(
|
||||||
's' + loc, dpid='%x' % dpid )
|
's' + loc, dpid='%x' % dpid )
|
||||||
for k in range( 0, n ):
|
for k in range( 0, n ):
|
||||||
host = hosts[ i, j, k ] = self.addHost( genHostName( loc, k + 1 ) )
|
host = hosts[ i, j, k ] = self.addHost(
|
||||||
|
genHostName( loc, k + 1 ) )
|
||||||
self.addLink( host, switch )
|
self.addLink( host, switch )
|
||||||
# Connect switches
|
# Connect switches
|
||||||
for i in range( 0, x ):
|
for i in range( 0, x ):
|
||||||
|
|||||||
Reference in New Issue
Block a user