Example #1
0
def run(data, quiet=False):  # do not edit this line
    """
    Executes plugin
    :param data: data to process
    :param quiet: work in reduced noise mode
    :return: returncode, out, err
    """

    # Return all metadata passed from citellus

    # For now, let's only print plugins that have rc ! $RC_OKAY in quiet
    if quiet:
        toprint = magui.maguiformat(data)
    else:
        toprint = data

    # We should filter metadata extension as is to be processed separately
    err = [
        toprint[item]
        for item in toprint
        if "backend" in toprint[item] and toprint[item]["backend"] == "metadata"
    ]

    # Do return different code if we've data
    if len(err) > 0:
        returncode = citellus.RC_FAILED
    else:
        returncode = citellus.RC_OKAY

    out = ""
    return returncode, out, err
Example #2
0
 def test_maguiformat(self):
     res = magui.maguiformat(data={})
     assert res == {}