1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-12 02:55:29 +00:00
community.general/tests/unit
AsifAd fde6b13a7f
ini_file: do not delete comment-only lines containing the option name
When state=present and exclusive=true, the cleanup loops in do_ini()
treated any line that contained the option name as a match, including
pure documentation comments such as "; output_buffering" that have no
"=" sign. As a result those lines were either rewritten in place or
deleted, even though they are not configuration entries.

Skip lines where match.group(2) is a comment character ("#" or ";") and
match.group(6) is empty (no "=" present). This keeps the existing
behaviour of replacing commented config lines like ";output_buffering = 4096"
when modify_inactive_option=true, while leaving doc comments untouched.

Adds two regression tests covering the exact scenario from the issue and
the simpler commented-config replacement case.

Fixes: https://github.com/ansible-collections/community.general/issues/11919
2026-06-03 23:22:54 +05:30
..
plugins ini_file: do not delete comment-only lines containing the option name 2026-06-03 23:22:54 +05:30
requirements.txt nsupdate: add unit tests (#11677) 2026-03-26 21:37:16 +01:00
requirements.yml Adjust YAML files (#10233) 2025-06-15 09:13:16 +02:00