-
Notifications
You must be signed in to change notification settings - Fork 0
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
Is there documented good way a plugin should deal with params ? #6
Comments
"Prior art" to this ticket: ansible/proposals#15 |
I just ported all core lookups that use options to the plugin config system, this should be the standard way of handling options. The current docs are generic about plugins but I'll follow up with specifics per plugin type, including lookups, but the short of it is: draft ansible/ansible#74495 (feedback welcome) |
@bcoca Thank You veriy much for the effort!
You probably saw, that I am trying to deal with legacy code: In #7 You can see me discovering (after days of chewing on the code) that:
And if put inside terms, there is some validation, where I can see an error, when I use a wrong option. So knowing "the way" to input validation for set_option in lookup plugins would greatly help me over that hurdle. |
set_options/set_option does that validation, the DOCUMENTATION is your argspec
This should be discontinued, but if you look at core lookups, I kept this for backwards compatibility (in next version I plan to add deprecation message) see ansible/ansible#74108 (PR that migrated all of them to use set_options/get_option). You can parse this way and use set_option to override the settings for that term (you might want to reset to global at start of term loop).
This should be the standard going forward |
Well then, for example... : The legacy code does this while parsing the "terms for options". |
use set_optoins/set_option, they do all the validation on required, type and matching existing settings. |
Now if go ahead and model "url is set " into this diagram in Readme
I still have three problems:
The text was updated successfully, but these errors were encountered: