[stable-10] sysrc: Use shlex (#10400)

* Fix #10394 Use configparser.

* Fix #10394 configparser is in Python3 only.

* Fix #10394 return condition.

* Fix #10394 Use ConfigParser with Python2.

* Fix #10394 import configparser from ansible.module_utils.six.moves

* Add changelog fragment.

* Update changelogs/fragments/10400-sysrc.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Fix #10394 use shlex instead of configparser.

* Update fragment.

* Update changelogs/fragments/10400-sysrc.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/sysrc.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Apply suggestions from code review.

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

* Copy tests from #10417.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
Vladimir Botka 2025-07-21 22:07:30 +02:00 committed by GitHub
commit 0be6e61b31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 68 additions and 4 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- "sysrc - use ``shlex`` to improve parsing of ``sysrc -e -a`` output (https://github.com/ansible-collections/community.general/issues/10394, https://github.com/ansible-collections/community.general/pull/10400)."