Merge pull request #252 from sieben/useless_parenthesis
fixup: useless_parenthesis
This commit is contained in:
+1
-1
@@ -59,7 +59,7 @@ def fixNetworkManager( root, intf ):
|
|||||||
cfile = '/etc/network/interfaces'
|
cfile = '/etc/network/interfaces'
|
||||||
line = '\niface %s inet manual\n' % intf
|
line = '\niface %s inet manual\n' % intf
|
||||||
config = open( cfile ).read()
|
config = open( cfile ).read()
|
||||||
if ( line ) not in config:
|
if line not in config:
|
||||||
print '*** Adding', line.strip(), 'to', cfile
|
print '*** Adding', line.strip(), 'to', cfile
|
||||||
with open( cfile, 'a' ) as f:
|
with open( cfile, 'a' ) as f:
|
||||||
f.write( line )
|
f.write( line )
|
||||||
|
|||||||
+3
-3
@@ -355,7 +355,7 @@ class Mininet( object ):
|
|||||||
"Build mininet."
|
"Build mininet."
|
||||||
if self.topo:
|
if self.topo:
|
||||||
self.buildFromTopo( self.topo )
|
self.buildFromTopo( self.topo )
|
||||||
if ( self.inNamespace ):
|
if self.inNamespace:
|
||||||
self.configureControlNetwork()
|
self.configureControlNetwork()
|
||||||
info( '*** Configuring hosts\n' )
|
info( '*** Configuring hosts\n' )
|
||||||
self.configHosts()
|
self.configHosts()
|
||||||
@@ -463,13 +463,13 @@ class Mininet( object ):
|
|||||||
"Parse ping output and return packets sent, received."
|
"Parse ping output and return packets sent, received."
|
||||||
# Check for downed link
|
# Check for downed link
|
||||||
if 'connect: Network is unreachable' in pingOutput:
|
if 'connect: Network is unreachable' in pingOutput:
|
||||||
return (1, 0)
|
return 1, 0
|
||||||
r = r'(\d+) packets transmitted, (\d+) received'
|
r = r'(\d+) packets transmitted, (\d+) received'
|
||||||
m = re.search( r, pingOutput )
|
m = re.search( r, pingOutput )
|
||||||
if m is None:
|
if m is None:
|
||||||
error( '*** Error: could not parse ping output: %s\n' %
|
error( '*** Error: could not parse ping output: %s\n' %
|
||||||
pingOutput )
|
pingOutput )
|
||||||
return (1, 0)
|
return 1, 0
|
||||||
sent, received = int( m.group( 1 ) ), int( m.group( 2 ) )
|
sent, received = int( m.group( 1 ) ), int( m.group( 2 ) )
|
||||||
return sent, received
|
return sent, received
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -168,7 +168,7 @@ class Topo(object):
|
|||||||
'''
|
'''
|
||||||
if src in self.ports and dst in self.ports[src]:
|
if src in self.ports and dst in self.ports[src]:
|
||||||
assert dst in self.ports and src in self.ports[dst]
|
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 ):
|
def linkInfo( self, src, dst ):
|
||||||
"Return link metadata"
|
"Return link metadata"
|
||||||
|
|||||||
Reference in New Issue
Block a user