Replies: 2 comments 5 replies
-
Hello, https://github.com/nornir-automation/nornir/blob/develop/nornir/plugins/inventory/simple.py#L97-L102 (same for Anyway, before deciding next steps I'd like to see first hand the error to see what's the actual problem (missing files isn't). I suspect though the problem might be that you assigned groups to hosts but Thanks for taking the time reporting the issue. |
Beta Was this translation helpful? Give feedback.
-
To make a back-reference, the issues have been fixed in the PRs here: |
Beta Was this translation helpful? Give feedback.
-
Dear all,
I stumbled upon this potential issue, and before I open one, I ask here: I tested my project-setup that uses nornir with a SimpleInventory and wondered why everything suddenly failed until I noticed that my test-SimpleInventory was lacking fields/files.
I reproduced the issue by creating a SimpleInventory that lacked
groups.yaml
anddefaults.yaml
, and only hasinventory/hosts.yaml
:(it works if the inventory is correctly set up)
I then looked into the code (https://github.com/nornir-automation/nornir/blob/develop/nornir/plugins/inventory/simple.py) and noticed there is no error handling that deals with non-existing files or a potentially erroneous config structure.
Is there a way for me to validate a SimpleInventory for correctness? If not, would it be welcomed to add some kind of error handling and/or validation to the SimpleInventory code? I'd be happy to help contributing, but since this would be my first contribution, I want to be sure I did not miss anything and hear your opinions first.
As always: thanks for your work and answers.
Edit: Running
napalm_get
on that erroneous SimpleInventory leads to this error - it would be helpful to know that it failed because of the wrong inventory structure:Edit: Colorized console output
Beta Was this translation helpful? Give feedback.
All reactions