diff --git a/examples/nat.py b/examples/nat.py index f8fb0b12908d588ee679128742061361e2df20e9..dada3638f05c82bfd40388ed966038342ca9b1a2 100755 --- a/examples/nat.py +++ b/examples/nat.py @@ -59,7 +59,7 @@ def fixNetworkManager( root, intf ): cfile = '/etc/network/interfaces' line = '\niface %s inet manual\n' % intf config = open( cfile ).read() - if ( line ) not in config: + if line not in config: print '*** Adding', line.strip(), 'to', cfile with open( cfile, 'a' ) as f: f.write( line ) diff --git a/mininet/net.py b/mininet/net.py index 55bb1c89cba59626f7adf40a912df698047367ee..91e354256e3e6e52dacebe6ef9114632df974b9e 100755 --- a/mininet/net.py +++ b/mininet/net.py @@ -355,7 +355,7 @@ def build( self ): "Build mininet." if self.topo: self.buildFromTopo( self.topo ) - if ( self.inNamespace ): + if self.inNamespace: self.configureControlNetwork() info( '*** Configuring hosts\n' ) self.configHosts() @@ -463,13 +463,13 @@ def _parsePing( pingOutput ): "Parse ping output and return packets sent, received." # Check for downed link if 'connect: Network is unreachable' in pingOutput: - return (1, 0) + return 1, 0 r = r'(\d+) packets transmitted, (\d+) received' m = re.search( r, pingOutput ) if m is None: error( '*** Error: could not parse ping output: %s\n' % pingOutput ) - return (1, 0) + return 1, 0 sent, received = int( m.group( 1 ) ), int( m.group( 2 ) ) return sent, received diff --git a/mininet/topo.py b/mininet/topo.py index 2ab455cd5cbf6395e1a454b3053f656a13dc8d94..f9c421fbc8f57dc72e0850ae72ebd9cab99ee41c 100644 --- a/mininet/topo.py +++ b/mininet/topo.py @@ -168,7 +168,7 @@ def port(self, src, dst): ''' if src in self.ports and dst in self.ports[src]: assert dst in self.ports and src in self.ports[dst] - return (self.ports[src][dst], self.ports[dst][src]) + return self.ports[src][dst], self.ports[dst][src] def linkInfo( self, src, dst ): "Return link metadata"