Skip to content

Commit de60ea1

Browse files
vbotkafelixfontein
andauthored
Fix #10120. Split key=value where value may comprise = (#10121)
* Fix #10120. Split key=value where value may comprise = * Added fragment. * Update plugins/modules/sysrc.py Co-authored-by: Felix Fontein <[email protected]> * Update changelogs/fragments/10121-sysrc-fix-split-first-separator.yml Co-authored-by: Felix Fontein <[email protected]> --------- Co-authored-by: Felix Fontein <[email protected]>
1 parent 86507e8 commit de60ea1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bugfixes:
2+
- "sysrc - split the output of ``sysrc -e -a`` on the first ``=`` only (https://github.com/ansible-collections/community.general/issues/10120, https://github.com/ansible-collections/community.general/pull/10121)."

plugins/modules/sysrc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def exists(self):
130130
Use this dictionary to preform the tests.
131131
"""
132132
(rc, out, err) = self.run_sysrc('-e', '-a')
133-
conf = dict([i.split('=') for i in out.splitlines()])
133+
conf = dict([i.split('=', 1) for i in out.splitlines()])
134134
if self.value is None:
135135
return self.name in conf
136136
else:

0 commit comments

Comments
 (0)