From 9dc82793c4d5001aa0e643418b2fe7663127fdc9 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 27 Jul 2022 08:37:43 +0200 Subject: [PATCH] xfconf: fix setting of boolean values (#5007) (#5013) (cherry picked from commit 9290381bea2d0f52f200307500714033e4088a43) Co-authored-by: Felix Fontein --- changelogs/fragments/4999-xfconf-bool.yml | 2 ++ plugins/module_utils/xfconf.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/4999-xfconf-bool.yml diff --git a/changelogs/fragments/4999-xfconf-bool.yml b/changelogs/fragments/4999-xfconf-bool.yml new file mode 100644 index 0000000000..8fcf27144e --- /dev/null +++ b/changelogs/fragments/4999-xfconf-bool.yml @@ -0,0 +1,2 @@ +bugfixes: + - "xfconf - fix setting of boolean values (https://github.com/ansible-collections/community.general/issues/4999, https://github.com/ansible-collections/community.general/pull/5007)." diff --git a/plugins/module_utils/xfconf.py b/plugins/module_utils/xfconf.py index 4028da3bef..5a4b4f05c6 100644 --- a/plugins/module_utils/xfconf.py +++ b/plugins/module_utils/xfconf.py @@ -14,7 +14,7 @@ def _values_fmt(values, value_types): result = [] for value, value_type in zip(values, value_types): if value_type == 'bool': - value = boolean(value) + value = 'true' if boolean(value) else 'false' result.extend(['--type', '{0}'.format(value_type), '--set', '{0}'.format(value)]) return result