From cf6f67045b9ecb168e8d34472340ac4d3b418ba0 Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Wed, 24 Mar 2010 14:41:40 -0700 Subject: [PATCH] Added two spaces before in-line # comments. --- examples/sshd.py | 6 +++--- mininet/cli.py | 2 +- mininet/log.py | 4 ++-- mininet/net.py | 14 +++++++------- mininet/node.py | 14 +++++++------- mininet/topolib.py | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/examples/sshd.py b/examples/sshd.py index e664118..9b11916 100755 --- a/examples/sshd.py +++ b/examples/sshd.py @@ -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 + '&' ) diff --git a/mininet/cli.py b/mininet/cli.py index 0f63341..292011d 100644 --- a/mininet/cli.py +++ b/mininet/cli.py @@ -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 ) diff --git a/mininet/log.py b/mininet/log.py index c34631e..5849d8c 100644 --- a/mininet/log.py +++ b/mininet/log.py @@ -40,8 +40,8 @@ class StreamHandlerNoNewline( logging.StreamHandler ): 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: diff --git a/mininet/net.py b/mininet/net.py index 19c3810..4eb5c1a 100755 --- a/mininet/net.py +++ b/mininet/net.py @@ -97,7 +97,7 @@ from mininet.util import quietRun, fixLimits 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 @@ class Mininet( object ): 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 @@ class Mininet( object ): """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 @@ class Mininet( object ): 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: diff --git a/mininet/node.py b/mininet/node.py index b50c3c4..cdc67e2 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -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 @@ class Node( object ): 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 diff --git a/mininet/topolib.py b/mininet/topolib.py index 098556f..6c2f1ee 100644 --- a/mininet/topolib.py +++ b/mininet/topolib.py @@ -25,7 +25,7 @@ class TreeTopo( Topo ): 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