Revision ba43451b mininet/node.py

View differences:

mininet/node.py
991 991
            exit( 1 )
992 992
        info = quietRun( 'ovs-vsctl --version' )
993 993
        cls.OVSVersion =  findall( '\d+\.\d+', info )[ 0 ]
994
        if cls.isOldOVS():
995
            print "using old version of ovs so startup will be slower"
996 994

  
997 995
    @classmethod
998 996
    def isOldOVS( cls ):
......
1055 1053
        self.cmd( 'ifconfig lo up' )
1056 1054
        # Annoyingly, --if-exists option seems not to work
1057 1055
        self.cmd( 'ovs-vsctl del-br', self )
1056
        int( self.dpid, 16 ) # DPID must be a hex string
1058 1057
        # Interfaces and controllers
1059 1058
        intfs = ' '.join( '-- add-port %s %s -- set Interface %s ofport_request=%s ' % ( self, intf, intf, self.ports[intf] )
1060 1059
                         for intf in self.intfList() if not intf.IP() )
......
1062 1061
                         for c in controllers )
1063 1062
        if self.listenPort:
1064 1063
            clist += ' ptcp:%s' % self.listenPort
1065
        # configure old version ov ovs
1066
        if self.isOldOVS():
1064
        # Construct big ovs-vsctl command for new versions of OVS
1065
        if not self.isOldOVS():
1066
            print "\nusing a newer ovs version"
1067
            cmd = ( 'ovs-vsctl add-br %s ' % self +
1068
                    '-- set Bridge %s ' % self +
1069
                    'other_config:datapath-id=%s ' % self.dpid +
1070
                    '-- set-fail-mode %s %s ' % ( self, self.failMode ) +
1071
                    intfs +
1072
                    '-- set-controller %s %s ' % (self, clist ) )
1073
        # Construct ovs-vsctl commands for old versions of OVS
1074
        else:
1075
            print "\nusing an older ovs version"
1067 1076
            self.cmd( 'ovs-vsctl add-br', self )
1068 1077
            for intf in self.intfList():
1069 1078
                if not intf.IP():
......
1072 1081
                'other_config:datapath-id=%s ' % self.dpid +
1073 1082
                '-- set-fail-mode %s %s ' % ( self, self.failMode ) +
1074 1083
                '-- set-controller %s %s ' % (self, clist ))
1075

  
1076
        int( self.dpid, 16 ) # DPID must be a hex string
1077
        # Construct big ovs-vsctl command
1078
        if not self.isOldOVS():
1079
            print "using a newer ovs version so startup will be faster"
1080
            cmd = ( 'ovs-vsctl add-br %s ' % self +
1081
                    '-- set Bridge %s ' % self +
1082
                    'other_config:datapath-id=%s ' % self.dpid +
1083
                    '-- set-fail-mode %s %s ' % ( self, self.failMode ) +
1084
                    intfs +
1085
                    '-- set-controller %s %s ' % (self, clist ) )
1086 1084
        if not self.inband:
1087 1085
            cmd += ( '-- set bridge %s '
1088 1086
                     'other-config:disable-in-band=true ' % self )

Also available in: Unified diff