-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
[WIP] Stop validate-modules from giving spurious E324 with suboptions #38962
Conversation
Currently the validator doesn't handle suboptions recursively anyway, but the presence of suboptions with a default confuses it leading to misleading errors like: E324 Value for "default" from the argument_spec ({'verify_ssl': True}) for "manageiq_connection" does not match the documentation (None)
0b1d16b
to
64bf416
Compare
The test
|
cc @sivel |
This is unfortunately the wrong place to handle this. What has been implemented in the manageiq modules is a workaround, due to an unreported bug in subspec options handling. There should be no need to supply a I have submitted a PR to resolve this within the options parser correctly, which would negate the need for the Once the above PR has been merged, I will be adding a further check to validate modules to disallow supplying If you have further questions please stop by IRC or the mailing list:
|
SUMMARY
validate-modules gives spurious errors like this (example from #38725):
ERROR: lib/ansible/modules/remote_management/manageiq/manageiq_dynamic_resource_definition.py:0:0: E324 Value for "default" from the argument_spec ({'verify_ssl': True}) for "manageiq_connection" does not match the documentation (None)
This is wrong —
manageiq_connection
has suboptions, both doc and argspec agree thaverify_ssl
suboption has default True.The real fix would be implementing the
TODO: needs to recursively traverse suboptions
.I'm not up to that, just trying to prevent the spurious error in this situation...
Suboptions will remain unchecked.
ISSUE TYPE
COMPONENT NAME
validate-modules
linter, specifically doc vs argspec default comparison implemented in #36247.ANSIBLE VERSION
on latest
devel
,ADDITIONAL INFORMATION
For above example,
doc
dict is:spec
dict is:Note that beside each sub-option having a
default
key, whole 'manageiq_connection' got'default': {'verify_ssl': True}
.If you look closely at error, this
{'verify_ssl': True}
is exactly what confuses it.find full set of ignores to delete (hope CI will help me with that).
invstigate new error:
ERROR: lib/ansible/modules/remote_management/manageiq/manageiq_provider.py:0:0: E326 Value for "choices" from the argument_spec ([]) for "api_version" does not match the documentation (['v2', 'v3'])