Apply suggestions from code review.

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
Felix Fontein 2025-07-21 10:24:39 +02:00
commit cd67a79b2d
2 changed files with 2 additions and 2 deletions

View file

@ -1,2 +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)."
- "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)."

View file

@ -136,7 +136,7 @@ class Sysrc(object):
if self.value is None:
return self.name in conf
else:
return self.name in conf and conf[self.name] == self.value
return conf.get(self.name) == self.value
def contains(self):
(rc, out, err) = self.run_sysrc('-n', self.name)