[PR #10005/e0a283bb backport][stable-10] Fix method exists in sysrc (#10034)

Fix method exists in sysrc (#10005)

* Fix method exists.

* Add changelog fragment.

* Update the exists method to pass the present method tests.

* Replace f-string formatting.

* Update changelogs/fragments/10005-fix-method-exists-in-sysrc.yml

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

* Add comment to the method exists.

* Update plugins/modules/sysrc.py

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

* Update changelogs/fragments/10005-fix-method-exists-in-sysrc.yml

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

* The improved comment formatting fixed.

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e0a283bb36)

Co-authored-by: Vladimir Botka <vbotka@gmail.com>
This commit is contained in:
patchback[bot] 2025-04-21 13:20:53 +02:00 committed by GitHub
commit 7aae8a94f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 12 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- sysrc - no longer always reporting ``changed=true`` when ``state=absent``. This fixes the method ``exists()`` (https://github.com/ansible-collections/community.general/issues/10004, https://github.com/ansible-collections/community.general/pull/10005).