daemon/core/netns/nodes.py
def detectoldbridge(self):
        ''' Occassionally, control net bridges from previously closed sessions are not cleaned up.
        Check if there are old control net bridges and delete them
        ''' 
        retstat, retstr = cmdresult([BRCTL_BIN,'show'])
        if retstat != 0:
            self.exception(coreapi.CORE_EXCP_LEVEL_FATAL, None,
                           "Unable to retrieve list of installed bridges")
        lines = retstr.split('\n')
        for line in lines[1:]:
            cols = line.split('\t')
            oldbr = cols[0]
            flds = cols[0].split('.')
            if len(flds) == 3:
                if flds[0] == 'b' and flds[1] == self.objid:
                    self.session.exception(coreapi.CORE_EXCP_LEVEL_FATAL, "CtrlNet.startup()", None,
                                           "Error: An active control net bridge (%s) found. "\
                                           "An older session might still be running. " \
                                           "Stop all sessions and, if needed, delete %s to continue." % \
                                           (oldbr, oldbr))
                    return True
                    '''
                    # Do this if we want to delete the old bridge
                    self.warn("Warning: Old %s bridge found: %s" % (self.objid, oldbr))
                    try:
                        check_call([BRCTL_BIN, 'delbr', oldbr])
                    except Exception, e:
                        self.exception(coreapi.CORE_EXCP_LEVEL_ERROR, oldbr,
                                       "Error deleting old bridge %s" % oldbr)
                    self.info("Deleted %s" % oldbr)
                    '''
        return False
 Occassionally, control net bridges from previously closed sessions are not cleaned up.
        Check if there are old control net bridges and delete them
        
Occassionally, control net bridges from previously closed sessions are not cleaned up.
Check if there are old control net bridges and delete them
Occassionally control net bridges from previously closed sessions are not cleaned up . Check if there are old control net bridges and delete them
def detectoldbridge(self):
        retstat, retstr = cmdresult([BRCTL_BIN,'show'])
        if retstat != 0:
            self.exception(coreapi.CORE_EXCP_LEVEL_FATAL, None,
                           "Unable to retrieve list of installed bridges")
        lines = retstr.split('\n')
        for line in lines[1:]:
            cols = line.split('\t')
            oldbr = cols[0]
            flds = cols[0].split('.')
            if len(flds) == 3:
                if flds[0] == 'b' and flds[1] == self.objid:
                    self.session.exception(coreapi.CORE_EXCP_LEVEL_FATAL, "CtrlNet.startup()", None,
                                           "Error: An active control net bridge (%s) found. "\
                                           "An older session might still be running. " \
                                           "Stop all sessions and, if needed, delete %s to continue." % \
                                           (oldbr, oldbr))
                    return True
        return False
def detectoldbridge ( self ) : retstat , retstr = cmdresult ( [ BRCTL_BIN , 'show' ] ) if retstat != 0 : self . exception ( coreapi . CORE_EXCP_LEVEL_FATAL , None , "Unable to retrieve list of installed bridges" ) lines = retstr . split ( '\n' ) for line in lines [ 1 : ] : cols = line . split ( '\t' ) oldbr = cols [ 0 ] flds = cols [ 0 ] . split ( '.' ) if len ( flds ) == 3 : if flds [ 0 ] == 'b' and flds [ 1 ] == self . objid : self . session . exception ( coreapi . CORE_EXCP_LEVEL_FATAL , "CtrlNet.startup()" , None , "Error: An active control net bridge (%s) found. " "An older session might still be running. " "Stop all sessions and, if needed, delete %s to continue." % ( oldbr , oldbr ) ) return True '''
                    # Do this if we want to delete the old bridge
                    self.warn("Warning: Old %s bridge found: %s" % (self.objid, oldbr))
                    try:
                        check_call([BRCTL_BIN, 'delbr', oldbr])
                    except Exception, e:
                        self.exception(coreapi.CORE_EXCP_LEVEL_ERROR, oldbr,
                                       "Error deleting old bridge %s" % oldbr)
                    self.info("Deleted %s" % oldbr)
                    ''' return False
Occassionally, control net bridges from previously closed sessions are not cleaned up.
Occassionally control net bridges from previously closed sessions are not cleaned up .
''' Occassionally, control net bridges from previously closed sessions are not cleaned up.
        Check if there are old control net bridges and delete them
        ''' '''
                    # Do this if we want to delete the old bridge
                    self.warn("Warning: Old %s bridge found: %s" % (self.objid, oldbr))
                    try:
                        check_call([BRCTL_BIN, 'delbr', oldbr])
                    except Exception, e:
                        self.exception(coreapi.CORE_EXCP_LEVEL_ERROR, oldbr,
                                       "Error deleting old bridge %s" % oldbr)
                    self.info("Deleted %s" % oldbr)
                    '''
self