Closed antoinekh closed 4 months ago
Hello,
nornir = "^3.4.1" python = ">=3.10,<3.12"
I have a grouping task where I have several tasks. I want to return the failed task to know what my failed checks are but I also want to do all the checks even if one of them fails.
def multiple_tasks(task): task.run(task=check_ntp, on_failed=True) task.run(task=check_logs, on_failed=True) task.run(task=check_non_bfd_bgp_timers, on_failed=True) task.run(task=check_bgp_with_bfd, on_failed=True) task.run(task=check_bgp_with_ap_mode, on_failed=True) nr = InitNornir(config_file="config.yaml") output = nr.run(task=multiple_tasks, on_failed=True)
I have tried to add the on_failed to each task but the generate this problem
r = self.task(self, **self.params) TypeError: check_ntp() got an unexpected keyword argument 'on_failed' failed
And when the on_failed is on the multiple_tasks, it's not take into account.
on_failed
Is there a way to do it?
https://github.com/nornir-automation/nornir/issues/699
This explains the reason for this behaviour, I will probably reorganise my code for this
Hello,
nornir = "^3.4.1" python = ">=3.10,<3.12"
I have a grouping task where I have several tasks. I want to return the failed task to know what my failed checks are but I also want to do all the checks even if one of them fails.
I have tried to add the on_failed to each task but the generate this problem
And when the
on_failed
is on the multiple_tasks, it's not take into account.Is there a way to do it?