community.general/lib/ansible/module_utils/common
Sam Doran ff88bd82b5
Move type checking methods out of basic.py and add unit tests (#53687)
* Move check_type_str() out of basic.py

* Move check_type_list() out of basic.py

* Move safe_eval() out of basic.py

* Move check_type_dict() out of basic.py

* Move json importing code to common location

* Move check_type_bool() out of basic.py

* Move _check_type_int() out of basic.py

* Move _check_type_float() out of basic.py

* Move _check_type_path() out of basic.py

* Move _check_type_raw() out of basic.py

* Move _check_type_bytes() out of basic.py

* Move _check_type_bits() out of basic.py

* Create text.formatters.py

Move human_to_bytes, bytes_to_human, and _lenient_lowercase out of basic.py into text.formatters.py
Change references in modules to point to function at new location

* Move _check_type_jsonarg() out of basic.py

* Rename json related functions and put them in common.text.converters

Move formatters.py to common.text.formatters.py and update references in modules.

* Rework check_type_str()

Add allow_conversion option to make the function more self-contained.
Move the messaging back to basic.py since those error messages are more relevant to using this function in the context of AnsibleModule and not when using the function in isolation.

* Add unit tests for type checking functions

* Change _lenient_lowercase to lenient_lowercase per feedback
2019-03-21 09:40:19 -04:00
..
text Move type checking methods out of basic.py and add unit tests (#53687) 2019-03-21 09:40:19 -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 Add a CLIArgs Singleton class that will hold the parse cli arguments 2019-01-03 18:12:23 -08:00
dict_transformations.py Fix pycodestyle E117 issues. 2019-02-13 23:35:39 -08:00
file.py Pull documentation of ansible.module_utils.basic from (improved) doc strings. (#48416) 2018-12-10 09:17:15 -06:00
network.py Move network utils that are used by AWS modules (#45579) 2018-10-02 15:08:00 -04:00
parameters.py Move _handle_no_log_values() out of basic.py (#48628) 2019-03-04 17:02:44 -05:00
process.py actually check we can run scm command for roles (#43315) 2018-07-31 13:04:05 -04:00
removed.py Fixup removed and deprecated modules 2018-08-24 15:37:13 -07:00
sys_info.py Use distro.id() instead of distro.name() (#52199) 2019-03-07 13:25:59 -05:00
validation.py Move type checking methods out of basic.py and add unit tests (#53687) 2019-03-21 09:40:19 -04:00