Beispiel #1
0
def _extract_neighbor_data(args):
    # single switch neighbor data update
    switch = args[0]
    if switch not in _updatelocks:
        _updatelocks[switch] = eventlet.semaphore.Semaphore()
    if _updatelocks[switch].locked():
        while _updatelocks[switch].locked():
            eventlet.sleep(1)
        return
    try:
        with _updatelocks[switch]:
            _extract_neighbor_data_b(args)
    except Exception:
        log.logtrace()
Beispiel #2
0
def _map_switch(args):
    try:
        return _map_switch_backend(args)
    except (UnicodeError, socket.gaierror):
        log.log({'error': "Cannot resolve switch '{0}' to an address".format(
            args[0])})
    except exc.TargetEndpointUnreachable:
        log.log({'error': "Timeout or bad SNMPv1 community string trying to "
                         "reach switch '{0}'".format(
            args[0])})
    except exc.TargetEndpointBadCredentials:
        log.log({'error': "Bad SNMPv3 credentials for \'{0}\'".format(
            args[0])})
    except Exception as e:
        log.log({'error': 'Unexpected condition trying to reach switch "{0}"'
                          ' check trace log for more'.format(args[0])})
        log.logtrace()
Beispiel #3
0
def _extract_neighbor_data(args):
    # single switch neighbor data update
    switch = args[0]
    if switch not in _updatelocks:
        _updatelocks[switch] = eventlet.semaphore.Semaphore()
    if _updatelocks[switch].locked():
        while _updatelocks[switch].locked():
            eventlet.sleep(1)
        return
    try:
        with _updatelocks[switch]:
            return _extract_neighbor_data_b(args)
    except Exception as e:
        yieldexc = False
        if len(args) >= 5:
            yieldexc = args[4]
        if yieldexc:
            return e
        else:
            log.logtrace()
Beispiel #4
0
def _extract_neighbor_data(args):
    try:
        _extract_neighbor_data_b(args)
    except Exception:
        log.logtrace()
Beispiel #5
0
def _map_switch(args):
    try:
        return _map_switch_backend(args)
    except Exception as e:
        log.logtrace()
Beispiel #6
0
def _map_switch(args):
    try:
        return _map_switch_backend(args)
    except Exception as e:
        log.logtrace()