Open jvanderaa opened 3 years ago
I can submit the request in if this would be good to go.
Which code are you referring to? Note that how to load inventory defaults is specific to the inventory plugin, we don't expect plugins to implement a specific mechanism. However, if people are trying to replicate what the SimpleInventory
does, I am ok cleaning that driver and turning it into a public API that can be leveraged by other drivers.
I would look at having this as a method within Nornir inventory - https://github.com/wvandeun/nornir_netbox/blob/develop/nornir_netbox/plugins/inventory/netbox.py#L39-L48, it appears there on the NetBox inventory and again on the Ansible inventory - https://github.com/carlmontanari/nornir_ansible/blob/master/nornir_ansible/plugins/inventory/ansible.py#L456-L472
Ok, makes sense, we could have a from_dict
static method on all of the public facing objects to do this magic.
It looks like there is some common code being implemented on Nornir NetBox and Nornir Ansible inventories. Which is something that will also be implemented into the Nornir Nautobot inventory as well. This should likely become a method that is common in the Nornir library.