Fix #10120. Split key=value where value may comprise = (#10121)
Some checks failed
EOL CI / EOL Sanity (Ⓐ2.15) (push) Has been cancelled
EOL CI / EOL Units (Ⓐ2.15+py2.7) (push) Has been cancelled
EOL CI / EOL Units (Ⓐ2.15+py3.10) (push) Has been cancelled
EOL CI / EOL Units (Ⓐ2.15+py3.5) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/1/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/2/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/3/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/1/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/2/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/3/) (push) Has been cancelled
nox / Run extra sanity tests (push) Has been cancelled

* Fix #10120. Split key=value where value may comprise =

* Added fragment.

* Update plugins/modules/sysrc.py

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

* Update changelogs/fragments/10121-sysrc-fix-split-first-separator.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Vladimir Botka 2025-05-12 21:51:00 +02:00 committed by GitHub
parent 86507e8aca
commit de60ea1da4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -130,7 +130,7 @@ class Sysrc(object):
Use this dictionary to preform the tests.
"""
(rc, out, err) = self.run_sysrc('-e', '-a')
conf = dict([i.split('=') for i in out.splitlines()])
conf = dict([i.split('=', 1) for i in out.splitlines()])
if self.value is None:
return self.name in conf
else: