ansible/lib/ansible/module_utils/common
Sam Doooran 5ecfb19cad
arg_spec - move validator lookup method to a function (#72667)
* arg_spec - move type checking lookup method to a function

* Change get_wanted_type name and behavior

Change the name to get_validator to bette describe what it is doing.

Change the interface to always return a value. This lines up with the behavior of get_*
functions always returning something or None and check_* functions raising an
Exception if something went wrong during the check.

* Add param to check_type_str()

Not meant to be a long term fix, but gets tests passing. More work is needed to figure
out how to solve this cleanly.

* Remove private attribute mapping types to validator

Since the function that needs it has moved to parameters.py, there is no need to have it as
a attribute of AnsibleModule.

Update tests that were referencing the private attribute.

* Use private method for 'str' type

To avoid having to put the string conversion warning behavior in the check_type_str() method,
use the private _check_type_str() method for 'str' type.

Import CHECK_ARGUMENT_TYPES_DISPATCHER for backwards compalitibility and store it as
a private attribute.

Revert changes to support plugins that are referencing serf._CHECK_ARGUMENT_TYPES_DISPATCHER.

* Add changelog

* Change function name to better reflect its... function

* Change dict name to better reflect its contents

CHECK_ARGUMENT_TYPES_DISPATCHER --> DEFAULT_TYPE_VALIDATORS

* Fix changelog
2020-12-17 17:15:00 -05:00
..
text Properly handle unicode in safe_eval (#68576) 2020-05-20 12:08:50 -04:00
__init__.py
_collections_compat.py Python 3.8 collections compatibility fixes. 2018-10-08 11:26:37 -07:00
_json_compat.py Move type checking methods out of basic.py and add unit tests (#53687) 2019-03-21 09:40:19 -04:00
_utils.py Cleanups to the common.sys_info API 2019-01-03 16:21:09 -08:00
collections.py AnsibleVaultEncryptedUnicode should be considered a string (#71609) 2020-09-03 14:54:00 -05:00
dict_transformations.py module_utils.common.*: removed unused objects (#59570) 2019-07-25 11:04:18 -04:00
file.py Revert "Change default file permissions so they are not world readable (#70221)" (#71231) 2020-08-12 12:29:04 -05:00
json.py AnsibleVaultEncryptedUnicode should be considered a string (#71609) 2020-09-03 14:54:00 -05:00
network.py Fix boilerplate in setup.py and lib/ansible/ dir. 2020-06-22 16:29:16 -07:00
parameters.py arg_spec - move validator lookup method to a function (#72667) 2020-12-17 17:15:00 -05:00
process.py Make get_bin_path() always raise an exception (#56813) 2020-01-30 12:54:25 -05:00
removed.py Nuke all removed_module stubs (#67139) 2020-02-05 16:29:27 -06:00
sys_info.py Replaces deprecated usage of functions in ansible.module_utils.basic (#63990) 2019-10-31 16:22:44 -04:00
validation.py arg_spec - rework _check_arguments() (#72447) 2020-11-18 14:15:33 -05:00
warnings.py Deprecation revisited (#69926) 2020-06-09 15:21:19 -07:00