Revision b1ec912d examples/cluster.py

View differences:

examples/cluster.py
87 87
from subprocess import Popen, PIPE, STDOUT
88 88
import os
89 89
from random import randrange
90
from sys import exit
90
import sys
91 91
import re
92 92

  
93 93
from distutils.version import StrictVersion
......
282 282
        cls = type( self )
283 283
        if self.server not in cls.OVSVersions:
284 284
            vers = self.cmd( 'ovs-vsctl --version' )
285
            cls.OVSVersions[ self.server ] = re.findall( '\d+\.\d+', vers )[ 0 ]
285
            cls.OVSVersions[ self.server ] = re.findall( r'\d+\.\d+', vers )[ 0 ]
286 286
        return ( StrictVersion( cls.OVSVersions[ self.server ] ) <
287 287
                StrictVersion( '1.10' ) )
288 288

  
......
387 387
            tunnel.wait()
388 388
            error( ch + tunnel.stdout.read() )
389 389
            error( tunnel.stderr.read() )
390
            exit( 1 )
390
            sys.exit( 1 )
391 391
        # 3. Move interfaces if necessary
392 392
        for node in node1, node2:
393 393
            if node.inNamespace:
......
643 643
        for server in self.servers:
644 644
            ip = self.serverIP[ server ]
645 645
            if not server or server == 'localhost':
646
                 continue
646
                continue
647 647
            info( server, '' )
648 648
            dest = '%s@%s' % ( self.user, ip )
649 649
            cmd = [ 'sudo', '-E', '-u', self.user ]
......
660 660
                   '*** Make sure that the above ssh command works correctly.\n'
661 661
                   '*** You may also need to run mn -c on all nodes, and/or\n'
662 662
                   '*** use sudo -E.\n' )
663
            exit( 1 )
663
            sys.exit( 1 )
664 664
        info( '\n' )
665 665

  
666 666
    def modifiedaddHost( self, *args, **kwargs ):
......
703 703
        if ( isinstance( controller, Controller)
704 704
             and controller.IP() == '127.0.0.1'
705 705
             and ' eth0:' in controller.cmd( 'ip link show' ) ):
706
             Intf( 'eth0', node=controller ).updateIP()
706
            Intf( 'eth0', node=controller ).updateIP()
707 707
        return controller
708 708

  
709 709
    def buildFromTopo( self, *args, **kwargs ):

Also available in: Unified diff