diff --git a/nornir/core/task.py b/nornir/core/task.py index d063d8fb..83189ca4 100644 --- a/nornir/core/task.py +++ b/nornir/core/task.py @@ -257,6 +257,12 @@ def __getattr__(self, name: str) -> Any: def __repr__(self) -> str: return "{}: {}".format(self.__class__.__name__, super().__repr__()) + def __getstate__(self) -> Dict[str, Any]: + return self.__dict__ + + def __setstate__(self, d) -> None: + self.__dict__.update(d) + @property def failed(self) -> bool: """If ``True`` at least a task failed."""