-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SimpleInventory crashes with empty hosts file #826
Comments
What is your use case where you need the SimpleInventory but empty? |
Hi @ubaumann Initial setup and install of a product to have an empty yaml file for users. What do you think? Is there a better way here given the exact intention? |
I would add a demo host to the configuration file. Mybe the localhost. Otherwise, you have to wait for the response of the maintainer on how he feels about a PR or implementing your inventory plugin. I assume it also fails if your host file looks like this?
|
Correct, it also fails. Currently I am making a util function that gets the file path from the config yaml and then does a kinda of validation check on the hosts file. I know the docs say hosts are mandatory so this might be a far fetched request but imo a crash is a really rough way to handle this. |
My concern with not crashing and allowing an empty hosts file is that if a user makes a typo and points to a file that doesn't exist (i.e. pointing to What I'd suggest is the following; create your own Inventory plugin that inherits from |
Hi, your code doesn't allow for an empty hosts file.
I find this perplexing given that groups and default yaml files have this check?
The text was updated successfully, but these errors were encountered: