Revision 824afb84

View differences:

examples/nat.py
59 59
    cfile = '/etc/network/interfaces'
60 60
    line = '\niface %s inet manual\n' % intf
61 61
    config = open( cfile ).read()
62
    if ( line ) not in config:
62
    if line not in config:
63 63
        print '*** Adding', line.strip(), 'to', cfile
64 64
        with open( cfile, 'a' ) as f:
65 65
            f.write( line )
mininet/net.py
355 355
        "Build mininet."
356 356
        if self.topo:
357 357
            self.buildFromTopo( self.topo )
358
        if ( self.inNamespace ):
358
        if self.inNamespace:
359 359
            self.configureControlNetwork()
360 360
        info( '*** Configuring hosts\n' )
361 361
        self.configHosts()
......
463 463
        "Parse ping output and return packets sent, received."
464 464
        # Check for downed link
465 465
        if 'connect: Network is unreachable' in pingOutput:
466
            return (1, 0)
466
            return 1, 0
467 467
        r = r'(\d+) packets transmitted, (\d+) received'
468 468
        m = re.search( r, pingOutput )
469 469
        if m is None:
470 470
            error( '*** Error: could not parse ping output: %s\n' %
471 471
                   pingOutput )
472
            return (1, 0)
472
            return 1, 0
473 473
        sent, received = int( m.group( 1 ) ), int( m.group( 2 ) )
474 474
        return sent, received
475 475

  
mininet/topo.py
168 168
        '''
169 169
        if src in self.ports and dst in self.ports[src]:
170 170
            assert dst in self.ports and src in self.ports[dst]
171
            return (self.ports[src][dst], self.ports[dst][src])
171
            return self.ports[src][dst], self.ports[dst][src]
172 172

  
173 173
    def linkInfo( self, src, dst ):
174 174
        "Return link metadata"

Also available in: Unified diff