How to use the citellus.findplugins function in citellus

To help you get started, we’ve selected a few citellus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github citellusorg / citellus / citellus / extensions / ansible-playbook.py View on Github external
def list(options):
    playbooksdir = os.path.join(citellus.citellusdir, PlaybooksFolder)
    playbooks = citellus.findplugins(folders=[playbooksdir], include=options.include, exclude=options.exclude,
                                     executables=False, extension=".yml")
    return playbooks
github citellusorg / citellus / citellus / magui.py View on Github external
def main():
    """
    Main code stub
    """
    options = parse_args()

    # Configure logging
    logging.basicConfig(level=options.loglevel)

    if not options.quiet:
        show_logo()

    # Each argument in sosreport is a sosreport

    # Prefill enabled citellus plugins from args
    citellusplugins = citellus.findplugins(folders=options.pluginpath, include=options.include, exclude=options.exclude)

    # Grab the data
    grouped = domagui(sosreports=options.sosreports, citellusplugins=citellusplugins)

    # For now, let's only print plugins that have rc ! 0 in quiet
    if options.quiet:
        toprint = maguiformat(grouped)
    else:
        toprint = grouped

    pprint.pprint(toprint, width=1)
    # We need to run our plugins against that data
github citellusorg / citellus / citellus / extensions / ansible-playbook.py View on Github external
def run(options):  # do not edit this line
    """
    Executes plugin
    :param options: options passed to main binary
    :return:
    """

    if not which("ansible-playbook"):
        print("# skipping ansible per missing ansible-playbook binary.")
        return

    playbooksdir = os.path.join(citellus.citellusdir, PlaybooksFolder)
    playbooks = citellus.findplugins(folders=[playbooksdir], include=options.include, exclude=options.exclude,
                                     executables=False, extension=".yml")
    playbooklive = []
    playbooksnap = []

    for playbook in playbooks:
        if citellus.regexpfile(file=playbook, regexp="CITELLUS_ROOT"):
            playbooksnap.append(playbook)
        else:
            playbooklive.append(playbook)

    # Restrict the playbooks to process to the running mode
    if options.live is True:
        playbooks = playbooklive
        playbookskipped = playbooksnap
    else:
        playbooks = playbooksnap

citellus

Utility for running set of tests against a Live System or a snapshot/sosreport

GPL-3.0
Latest version published 4 years ago

Package Health Score

60 / 100
Full package analysis

Similar packages