You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/lib/ansible/parsing
Matt Clay da2cd157f1
Fix arg splitting and key/value parsing (#80030)
* Improve readability of unit test output

This drops the trailing `-expectedXXX` suffixes from test names generated by parametrize.

* Add more splitter unit tests

This fills in code coverage gaps in the exising unit tests.

* Bug fixes and code cleanup

- Fix IndexError exceptions caused by parsing a leading newline, space or escaped space.
- Fix an AttributeError exception in `parse_args` when parsing `None`.
- Fix incorrect parsing of multi-line Jinja2 blocks, which resulted in doubling newlines.
- Remove unreachable exception handlers in the `parse_kv` function.
  The unreachable code was verified through analysis of the code as well as use of the `atheris` fuzzer.
- Remove unnecessary code in the `split_args` function.
- Add an optimization to `split_args` for the empty args case.

* Add unit tests for bug fixes

The splitter code is now fully covered by unit tests.

* Add another issue ref in changelog
1 year ago
..
utils Use ansible.module_utils.common.text.converters (#80704) 1 year ago
vault Fix pylint disallowed-name errors (#80854) 1 year ago
yaml Use ansible.module_utils.common.text.converters (#80704) 1 year ago
__init__.py Fix typo in lib/ansible/parsing/__init__.py (#16761) 8 years ago
ajson.py Clean up unused imports in core (#79900) 1 year ago
dataloader.py Use ansible.module_utils.common.text.converters (#80704) 1 year ago
mod_args.py Use ansible.module_utils.common.text.converters (#80704) 1 year ago
plugin_docs.py replace deprecated ast.value.s with ast.value.value (#80968) 1 year ago
quoting.py ansible/parsing: PEP8 compliancy (#24701) 7 years ago
splitter.py Fix arg splitting and key/value parsing (#80030) 1 year ago