From 824afb84c94b35fbc16c4c0e8ba66180913efe00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= <remy.leone@gmail.com> Date: Fri, 20 Dec 2013 14:43:30 +0100 Subject: [PATCH] fixup: useless_parenthesis --- examples/nat.py | 2 +- mininet/net.py | 6 +++--- mininet/topo.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/nat.py b/examples/nat.py index f8fb0b12..dada3638 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 55bb1c89..91e35425 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 2ab455cd..f9c421fb 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" -- GitLab