From a634cc2928fb0a710621293916cc95dfb5e25db1 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Thu, 15 Dec 2022 06:48:33 +0100 Subject: [PATCH] [stable-5] gconftool2: fix index error (#5687) Fix index error. --- changelogs/fragments/5687-gconftool2.yml | 2 ++ plugins/modules/system/gconftool2.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/5687-gconftool2.yml diff --git a/changelogs/fragments/5687-gconftool2.yml b/changelogs/fragments/5687-gconftool2.yml new file mode 100644 index 0000000000..4a35131efa --- /dev/null +++ b/changelogs/fragments/5687-gconftool2.yml @@ -0,0 +1,2 @@ +bugfixes: + - "gconftool2 - fix crash that prevents setting a key (https://github.com/ansible-collections/community.general/issues/5591, https://github.com/ansible-collections/community.general/pull/5687)." diff --git a/plugins/modules/system/gconftool2.py b/plugins/modules/system/gconftool2.py index 7ade53e3f4..f50abc76ee 100644 --- a/plugins/modules/system/gconftool2.py +++ b/plugins/modules/system/gconftool2.py @@ -125,7 +125,7 @@ class GConf2Preference(object): elif call_type == 'set': cmd.extend(direct) cmd.extend(config_source) - cmd.extend(["--type", self.value_type, "--{3}".format(call_type), self.key, self.value]) + cmd.extend(["--type", self.value_type, "--{0}".format(call_type), self.key, self.value]) elif call_type == 'unset': cmd.extend(["--unset", self.key])