[PR #10417/44ca3661 backport][stable-11] sysrc: refactor (#10504)

sysrc: refactor (#10417)

* sysrc: refactor

* sysrc: refactor changelog fragment

* sysrc: forgot the os import

* sysrc: update test to edit the correct file

* sysrc: Added copyright info to the test conf file

* sysrc: Added full copyright info to the test conf file

* sysrc: Detect permission denied when using sysrc

* sysrc: Fixed the permission check and 2.7 compatibility

* sysrc: Fix typo of import

* sysrc: Fix err.find check

* sysrc: Add bugfixes changelog fragment

* sysrc: Use `StateModuleHelper`

* sysrc: updated imports

* sysrc: remove re import and set errno.EACCES on the OSError

* sysrc: format code properly

* sysrc: fix Python 2.7 compatibility and set changed manually

* sysrc: add missing name format check

Also use `self.module.fail_json` through out

* sysrc: Removed os import by accident

* sysrc: updated per review, and the way the existing value is retrieved

(cherry picked from commit 44ca366173)

Co-authored-by: David Lundgren <dlundgren@syberisle.net>
This commit is contained in:
patchback[bot] 2025-07-28 19:21:55 +02:00 committed by GitHub
commit 6e0c62d3e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 177 additions and 136 deletions

View file

@ -0,0 +1,4 @@
minor_changes:
- sysrc - adjustments to the code (https://github.com/ansible-collections/community.general/pull/10417).
bugfixes:
- sysrc - fixes parsing with multi-line variables (https://github.com/ansible-collections/community.general/issues/10394, https://github.com/ansible-collections/community.general/pull/10417).