예제 #1
0
def get_metadata(plugin):
    """
    Gets metadata for plugin
    :param plugin: plugin object
    :return: metadata dict for that plugin
    """

    return risu.generic_get_metadata(plugin)
예제 #2
0
파일: nagios.py 프로젝트: risuorg/risu
def get_metadata(plugin):
    """
    Gets metadata for plugin
    :param plugin: plugin object
    :return: metadata dict for that plugin
    """

    metadata = risu.generic_get_metadata(plugin=plugin)
    metadata["backend"] = "nagios"
    return metadata
예제 #3
0
def get_metadata(plugin):
    """
    Gets metadata for plugin
    :param plugin: plugin object
    :return: metadata dict for that plugin
    """

    description = ""

    metadata = risu.generic_get_metadata(plugin=plugin)
    metadata.update({"description": description, "priority": 333})

    return metadata
예제 #4
0
def get_metadata(plugin):
    """
    Gets metadata for plugin
    :param plugin: plugin object
    :return: metadata dict for that plugin
    """

    metadata = risu.generic_get_metadata(plugin=plugin)

    subcategory = os.path.split(plugin["plugin"])[0].replace(pluginsdir, "")
    category = os.path.normpath(subcategory).split(os.sep)[1] or ""
    metadata.update({"subcategory": subcategory, "category": category})

    return metadata
예제 #5
0
def get_metadata(plugin):
    """
    Gets meadata for plugin
    :param plugin: plugin object
    :return: metadata dict for that plugin
    """

    with open(plugin["plugin"], "r") as stream:
        try:
            doc = yaml.safe_load(stream)
        except:
            doc = ""

    try:
        description = doc[0]["vars"]["metadata"]["description"]
    except:
        description = ""

    metadata = risu.generic_get_metadata(plugin=plugin)
    metadata.update({"description": description})

    return metadata