From b371edba6fd908064d082379536af84f917c5c52 Mon Sep 17 00:00:00 2001 From: augustus Date: Tue, 15 Feb 2022 21:40:05 -0300 Subject: [PATCH] Remove test script from repo --- config.yaml | 8 -------- main.py | 21 --------------------- 2 files changed, 29 deletions(-) delete mode 100644 config.yaml delete mode 100644 main.py diff --git a/config.yaml b/config.yaml deleted file mode 100644 index b78c6ab..0000000 --- a/config.yaml +++ /dev/null @@ -1,8 +0,0 @@ -inventory: - plugin: CsvInventory -runner: - plugin: ProgressBar - options: - num_workers: 5 - desc: "toto tata" - diff --git a/main.py b/main.py deleted file mode 100644 index 8d62053..0000000 --- a/main.py +++ /dev/null @@ -1,21 +0,0 @@ -from nornir import InitNornir -from nornir.core.plugins.runners import RunnersPluginRegister -from plugins.runners.progressbar import ThreadedProgressBarRunner, SerialProgressBarRunner -from nornir.core.plugins.inventory import InventoryPluginRegister -from nornir_csv.plugins.inventory import CsvInventory -from nornir.core.task import Task, Result -from time import sleep -from random import random - -def hello_world(task: Task) -> Result: - sleep(random()*10) - return Result( - result=f"Hello {task.host}", - host=task.host, - changed=False,) - -RunnersPluginRegister.register("ProgressBar", ThreadedProgressBarRunner) -InventoryPluginRegister.register("CsvInventory", CsvInventory) - -nr = InitNornir(config_file="config.yaml") -results = nr.run(task=hello_world)