Merge pull request #252 from sieben/useless_parenthesis

fixup: useless_parenthesis
This commit is contained in:
lantz
2014-01-28 15:22:53 -08:00
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -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 )
+3 -3
View File
@@ -355,7 +355,7 @@ class Mininet( object ):
"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 @@ class Mininet( object ):
"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
+1 -1
View File
@@ -168,7 +168,7 @@ class Topo(object):
'''
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"