(**kwargs)
Run reactions in a function
Run reactions in a function
Run reactions in a function
def runAction(**kwargs):
    ''' Run reactions in a function '''
    # TODO: Once the old style actions are killed, we can fold all the logging
    # logic in the BaseReaction class itself.
    redata = kwargs['redata']
    jdata = kwargs['jdata']
    try:
        react = runNewStyleAction(**kwargs)
    except Exception as e:
        logger.error("Got error when attempting to run reaction %s for monitor %s" % (
            redata['rtype'], jdata['cid']))
        logger.error(e)
        react = False
    if react is True:
        logger.info("Successfully processed %s reaction type %s for monitor %s" % (
            jdata['check']['status'], redata['rtype'], jdata['cid']))
        return True
    elif react is None:
        logger.info("Skipped %s reaction type %s for monitor %s" % (
            jdata['check']['status'], redata['rtype'], jdata['cid']))
        return None
    else:
        logger.info("Processing %s reaction type %s for monitor %s did not occur" % (
            jdata['check']['status'], redata['rtype'], jdata['cid']))
        return False
def runAction ( * * kwargs ) : # TODO: Once the old style actions are killed, we can fold all the logging # logic in the BaseReaction class itself. redata = kwargs [ 'redata' ] jdata = kwargs [ 'jdata' ] try : react = runNewStyleAction ( * * kwargs ) except Exception as e : logger . error ( "Got error when attempting to run reaction %s for monitor %s" % ( redata [ 'rtype' ] , jdata [ 'cid' ] ) ) logger . error ( e ) react = False if react is True : logger . info ( "Successfully processed %s reaction type %s for monitor %s" % ( jdata [ 'check' ] [ 'status' ] , redata [ 'rtype' ] , jdata [ 'cid' ] ) ) return True elif react is None : logger . info ( "Skipped %s reaction type %s for monitor %s" % ( jdata [ 'check' ] [ 'status' ] , redata [ 'rtype' ] , jdata [ 'cid' ] ) ) return None else : logger . info ( "Processing %s reaction type %s for monitor %s did not occur" % ( jdata [ 'check' ] [ 'status' ] , redata [ 'rtype' ] , jdata [ 'cid' ] ) ) return False