def get_action_by_id(action_id):
    """
    Get Action by id.

    On error, raise StackStormDBObjectNotFoundError
    """
    action = None

    try:
        action = Action.get_by_id(action_id)
    except (ValueError, ValidationError) as e:
        LOG.warning(
            'Database lookup for action with id="%s" resulted in ' "exception: %s",
            action_id,
            e,
        )
        raise StackStormDBObjectNotFoundError(
            "Unable to find action with " 'id="%s"' % action_id
        )

    return action

    Get Action by id.

    On error, raise StackStormDBObjectNotFoundError
    
st2common/st2common/util/action_db.py