mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 10:51:24 -07:00
* Fix for issue ansible/ansible#27715 * Also fixing mutually exclusive check * Updating subspec checks These changes take into account a spec with all features enabled and do the following tests for subspecs: 1. Test proper specs 2. Test Alias 3. Test missing required param 4. Test mutually exclusive params 5. Test required if params 6. Test required one of params 7. Test required together params 8. Test required if params with a default value 9. Test basis subspec params 10. Test invalid subsec params
This commit is contained in:
parent
3f12fccd02
commit
6d33e59ca1
2 changed files with 39 additions and 37 deletions
|
@ -1951,7 +1951,7 @@ class AnsibleModule(object):
|
|||
|
||||
# check exclusive early
|
||||
if not self.bypass_checks:
|
||||
self._check_mutually_exclusive(self.mutually_exclusive, param)
|
||||
self._check_mutually_exclusive(v.get('mutually_exclusive', None), param)
|
||||
|
||||
self._set_defaults(pre=True, spec=spec, param=param)
|
||||
|
||||
|
@ -1960,9 +1960,9 @@ class AnsibleModule(object):
|
|||
self._check_argument_types(spec, param)
|
||||
self._check_argument_values(spec, param)
|
||||
|
||||
self._check_required_together(self.required_together, param)
|
||||
self._check_required_one_of(self.required_one_of, param)
|
||||
self._check_required_if(self.required_if, param)
|
||||
self._check_required_together(v.get('required_together', None), param)
|
||||
self._check_required_one_of(v.get('required_one_of', None), param)
|
||||
self._check_required_if(v.get('required_if', None), param)
|
||||
|
||||
self._set_defaults(pre=False, spec=spec, param=param)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue