Function to test Nornir operation and produce valid results without the need to interact with devices directly.
nr_test sample usage
Code to invoke
from nornir_salt.plugins.tasks import nr_test output = nr.run(task=nr_test, abc=123)
Returns Nornir results object with task results populated in accordance with arguments supplied to task call.
- nornir_salt.plugins.tasks.nr_test.nr_test(task, ret_data_per_host=None, ret_data='__undefined_value__', excpt=None, excpt_msg='', **kwargs)
Dummy task that echoes data passed to it. Useful to debug and verification of Nornir object operation.
ret_data_per_host – (dict) Dictionary keyed by host name with values to include in results
ret_data – Any data to include in results, same for each host
kwargs – Any key-value pair to include in results, same for each host
excpt – (obj or True) exception object to raise; if True, raises
excpt_msg – (str) message to use with exception
- Return result
**kwargspassed to the task
Order of preference of return data:
ret_data_per_hostpresent, it is used to form results
excptobject supplied, it is raised
ret_datapresent, it is included in results
**kwargssupplied, they are included in results