Skip to content
Snippets Groups Projects
Commit cf6f6704 authored by Bob Lantz's avatar Bob Lantz
Browse files

Added two spaces before in-line # comments.

parent 35341142
No related branches found
No related tags found
No related merge requests found
......@@ -47,9 +47,9 @@ def connectToRootNS( network, switch, ip, prefixLen, routes ):
def sshd( network, cmd='/usr/sbin/sshd', opts='-D' ):
"Start a network, connect it to root ns, and run sshd on all hosts."
switch = network.switches[ 0 ] # switch to use
ip = '10.123.123.1' # our IP address on host network
routes = [ '10.0.0.0/8' ] # host networks to route to
switch = network.switches[ 0 ] # switch to use
ip = '10.123.123.1' # our IP address on host network
routes = [ '10.0.0.0/8' ] # host networks to route to
connectToRootNS( network, switch, ip, 8, routes )
for host in network.hosts:
host.cmd( cmd + ' ' + opts + '&' )
......
......@@ -43,7 +43,7 @@ class CLI( Cmd ):
def __init__( self, mininet ):
self.mn = mininet
self.nodelist = self.mn.controllers + self.mn.switches + self.mn.hosts
self.nodemap = {} # map names to Node objects
self.nodemap = {} # map names to Node objects
for node in self.nodelist:
self.nodemap[ node.name ] = node
Cmd.__init__( self )
......
......@@ -40,8 +40,8 @@ def emit( self, record ):
traceback.printException and appended to the stream."""
try:
msg = self.format( record )
fs = '%s' # was '%s\n'
if not hasattr( types, 'UnicodeType' ): #if no unicode support...
fs = '%s' # was '%s\n'
if not hasattr( types, 'UnicodeType' ): # if no unicode support...
self.stream.write( fs % msg )
else:
try:
......
......@@ -97,7 +97,7 @@
from mininet.util import createLink, macColonHex, ipStr, ipParse
from mininet.xterm import cleanUpScreens, makeXterms
DATAPATHS = [ 'kernel' ] #[ 'user', 'kernel' ]
DATAPATHS = [ 'kernel' ] # [ 'user', 'kernel' ]
def init():
"Initialize Mininet."
......@@ -147,10 +147,10 @@ def __init__( self, topo, switch=KernelSwitch, host=Host,
self.hosts = []
self.switches = []
self.controllers = []
self.nameToNode = {} # name to Node (Host/Switch) objects
self.idToNode = {} # dpid to Node (Host/Switch) objects
self.dps = 0 # number of created kernel datapaths
self.terms = [] # list of spawned xterm processes
self.nameToNode = {} # name to Node (Host/Switch) objects
self.idToNode = {} # dpid to Node (Host/Switch) objects
self.dps = 0 # number of created kernel datapaths
self.terms = [] # list of spawned xterm processes
switch.setup()
......@@ -188,7 +188,7 @@ def addController( self, controller ):
"""Add controller.
controller: Controller class"""
controller = self.controller( 'c0', self.inNamespace )
if controller: # allow controller-less setups
if controller: # allow controller-less setups
self.controllers.append( controller )
self.nameToNode[ 'c0' ] = controller
......@@ -390,7 +390,7 @@ def monitor( self, hosts=None ):
if hosts is None:
hosts = self.hosts
poller = select.poll()
Node = hosts[ 0 ] # so we can call class method fdToNode
Node = hosts[ 0 ] # so we can call class method fdToNode
for host in hosts:
poller.register( host.stdout )
while True:
......
......@@ -56,8 +56,8 @@ class Node( object ):
"""A virtual network node is simply a shell in a network namespace.
We communicate with it using pipes."""
inToNode = {} # mapping of input fds to nodes
outToNode = {} # mapping of output fds to nodes
inToNode = {} # mapping of input fds to nodes
outToNode = {} # mapping of output fds to nodes
def __init__( self, name, inNamespace=True,
defaultMAC=None, defaultIP=None ):
......@@ -84,11 +84,11 @@ def __init__( self, name, inNamespace=True,
self.outToNode[ self.stdout.fileno() ] = self
self.inToNode[ self.stdin.fileno() ] = self
self.pid = self.shell.pid
self.intfs = {} # dict of port numbers to interface names
self.ports = {} # dict of interface names to port numbers
# replace with Port objects, eventually ?
self.ips = {} # dict of interfaces to ip addresses as strings
self.connection = {} # remote node connected to each interface
self.intfs = {} # dict of port numbers to interface names
self.ports = {} # dict of interface names to port numbers
# replace with Port objects, eventually ?
self.ips = {} # dict of interfaces to ip addresses as strings
self.connection = {} # remote node connected to each interface
self.execed = False
self.defaultIP = defaultIP
self.defaultMAC = defaultMAC
......
......@@ -25,7 +25,7 @@ def addTree( self, n, depth, fanout ):
for i in range( 0, fanout ):
child = n + 1
self.add_edge( me, child )
n = self.addTree( child, depth-1, fanout )
n = self.addTree( child, depth - 1, fanout )
return n
# pylint: enable-msg=W0612
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment