Can anyone elaborate, perhaps with some examples on how to access results from tasks?
Through trial and error I’ve discovered the below works, but would be great if anyone could expand on exactly what’s going on with the task result objects. For example when trying to access task results directly i usually get an undescriptable error, I suppose this is by design and is part of the nature of the nornir result object?
for host, task_results in lldpneighbors.items():
#Store results from Nornir aggregated result object?
lldp_result = task_results.result
#store actual result dicitonary from the Nornir result object?
lldp_detail = lldp_result[‘lldp_neighbors_detail’]
for interface in lldp_detail: remotesysid = lldp_detail[interface]['remote_chassis_id'] #and so on
Is there a cleaner way to access results after tasks have been run or do so by hostname as shown here with the task.hostp’config’] ?