mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-31 05:19:09 -07:00
Argument spec must be dict/hash (#40858)
validate-modules should fail when argument is not dict/hash. Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
c989b62eef
commit
27b85e732d
2 changed files with 8 additions and 0 deletions
|
@ -1036,6 +1036,13 @@ class ModuleValidator(Validator):
|
|||
args_from_argspec = set()
|
||||
deprecated_args_from_argspec = set()
|
||||
for arg, data in spec.items():
|
||||
if not isinstance(data, dict):
|
||||
self.reporter.error(
|
||||
path=self.object_path,
|
||||
code=331,
|
||||
msg="argument '%s' in argument_spec must be a dictionary/hash when used" % arg,
|
||||
)
|
||||
continue
|
||||
if not data.get('removed_in_version', None):
|
||||
args_from_argspec.add(arg)
|
||||
args_from_argspec.update(data.get('aliases', []))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue