nornir.core.processor

class nornir.core.processor.Processor(*args, **kwargs)

Interface that defines the Processor plugins.

A processor plugin needs to implement each method with the same exact signature. It’s not necessary to subclass this class.

A processor is a plugin that gets called when certain events happen.

subtask_instance_completed(task: Task, host: Host, result: MultiResult) None

Handle the event fired when a host completes executing a subtask.

subtask_instance_started(task: Task, host: Host) None

Handle the event fired before a host starts executing a subtask.

task_completed(task: Task, result: AggregatedResult) None

Handle the event fired when all the hosts have completed their respective task.

task_instance_completed(task: Task, host: Host, result: MultiResult) None

Handle the event fired when a host completes its instance of a task.

task_instance_started(task: Task, host: Host) None

Handle the event fired before a host starts executing its instance of the task.

task_started(task: Task) None

Handle the event fired right before starting the task.

class nornir.core.processor.Processors(iterable=(), /)

Wrapper class that holds a list of Processor objects.

Each method will just iterate over all the Processor objects in self and call its method. For instance:

>>>    def my_method(...):
>>>        for p in self:
>>>            p.my_method(...)
subtask_instance_completed(task: Task, host: Host, result: MultiResult) None
subtask_instance_started(task: Task, host: Host) None
task_completed(task: Task, result: AggregatedResult) None
task_instance_completed(task: Task, host: Host, result: MultiResult) None
task_instance_started(task: Task, host: Host) None
task_started(task: Task) None