def get_rulesets(engine=""):
    """return a list of locally stored ruleset for jobs to use"""
    ruleset_list = []
    logger.debug("in get_rulesets(engine=%s)" % engine)
    # engine var should already be validated but just in case
    if not re.match(r"^[a-zA-Z0-9\_\-\.]*$", engine):
        logger.error("Invalid engine value '%s' in get_rulesets()" % engine)
        return ruleset_list
    ruleset_dir = os.path.join(RULESET_STORAGE_PATH, clean_path(engine))
    if not os.path.isdir(ruleset_dir):
        logger.error("Could not find ruleset directory '%s'" % ruleset_dir)
        return ruleset_list
    file_list = os.listdir(ruleset_dir)
    # do we want to descend into directories?
    for file in file_list:
        if not os.path.isfile(os.path.join(ruleset_dir, file)):
            continue
        if os.path.splitext(file)[1] == ".rules":
            # just add file (base) for now so we can sort; build 2D list on return
            ruleset_list.append(os.path.basename(file))
    # sort
    ruleset_list.sort(reverse=True)

    # return 2D array with base and full path
    return [[file, os.path.join(ruleset_dir, file)] for file in ruleset_list]
return a list of locally stored ruleset for jobs to use
app/dalton.py