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])