Example #1
0
 def with_processors(self, processors: List[Processor]) -> "Nornir":
     """
     Given a list of Processor objects return a copy of the nornir object with the processors
     assigned to the copy. The orinal object is left unmodified.
     """
     return Nornir(**{
         **self.__dict__,
         **{
             "processors": Processors(processors)
         }
     })
Example #2
0
 def __init__(
     self,
     inventory: Inventory,
     config: Config = None,
     data: GlobalState = None,
     processors: Optional[Processors] = None,
 ) -> None:
     self.data = data if data is not None else GlobalState()
     self.inventory = inventory
     self.config = config or Config()
     self.processors = processors or Processors()