Closed jvanderaa closed 11 months ago
I think if we want to go down this path and support this we should add a from_dict
static method to all of the user facing objects (i.e. Host.from_dict(...)
, Group.from_dict(...)
).
Basically that from_dict
method should mean that a_host == Host.from_dict(a_host.dict())
with one exception; groups should be excluded and post-processed or you might end up in the situation where groups don't exist before trying to create the reference.
Thoughts?
That makes sense. It may take me a little bit longer to get back on that particular update. I also need to check on what is going on with the tests that are failing here now after locally testing.
Re failing tests, you may need to rebase as it's due to some breaking changes github actions did. Kirk fixed those already a few days ago though so hopefully you don't have to do anything about them.
I've still got this on my radar. I've just come down with a bit of a cold that has knocked me out of working much lately...
No worries, get well!
I'm getting this in front of me a bit more. I thought I had something but the tests are not working. So I am going to try to restart the process on another branch.
@jvanderaa What is the status of this?
Is this dead now i.e. should be closed?
Yeah, probably good to close out. Sorry for leaving it for so long @ktbyers
@jvanderaa No worries at all.
Fixes #723
Details
https://github.com/wvandeun/nornir_netbox/blob/develop/nornir_netbox/plugins/inventory/netbox.py#L39-L48 https://github.com/carlmontanari/nornir_ansible/blob/master/nornir_ansible/plugins/inventory/ansible.py#L456-L472