From 7c46b7edbcfe25853c95a70d5058084333ab2a83 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 17 Nov 2025 06:45:44 +0100 Subject: [PATCH] [PR #11088/7f47deed backport][stable-12] dconf: deprecate fallback mechanism (#11094) dconf: deprecate fallback mechanism (#11088) * dconf: deprecate fallback mechanism * add changelog frag (cherry picked from commit 7f47deed64d72298aeb03bde1e0f97a73a53bdc0) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- .../fragments/11088-deprecate-dconf-fallback.yml | 2 ++ plugins/modules/dconf.py | 16 +++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 changelogs/fragments/11088-deprecate-dconf-fallback.yml diff --git a/changelogs/fragments/11088-deprecate-dconf-fallback.yml b/changelogs/fragments/11088-deprecate-dconf-fallback.yml new file mode 100644 index 0000000000..afc79ba395 --- /dev/null +++ b/changelogs/fragments/11088-deprecate-dconf-fallback.yml @@ -0,0 +1,2 @@ +deprecated_features: + - dconf - deprecate fallback mechanism when ``gi.repository`` is not available; fallback will be removed in community.general 15.0.0 (https://github.com/ansible-collections/community.general/pull/11088). diff --git a/plugins/modules/dconf.py b/plugins/modules/dconf.py index 2ee956c334..de78131950 100644 --- a/plugins/modules/dconf.py +++ b/plugins/modules/dconf.py @@ -26,8 +26,12 @@ notes: - This module uses the C(gi.repository) Python library when available for accurate comparison of values in C(dconf) to values specified in Ansible code. C(gi.repository) is likely to be present on most systems which have C(dconf) but may not be present everywhere. When it is missing, a simple string comparison between values is used, and there may be false positives, - that is, Ansible may think that a value is being changed when it is not. This fallback is to be removed in a future version - of this module, at which point the module C(gi.repository) is going to be required. + that is, Ansible may think that a value is being changed when it is not. This fallback is to be removed in version 15.0.0 + of this collection, at which point the module C(gi.repository) is going to be required. + - The library C(gi.repository) is usually provided by operating system packages (C(python3-gi) for Ubuntu/Debian, + C(python3-gobject) for Red Hat/Fedora, C(python-gobject) for Archlinux, to mention a few). + It is available in PyPI as C(PyGObject) but it only provides bindings for system libraries, so using the system packages + is highly recommended over installing it with C(pip). - Detection of existing, running D-Bus session, required to change settings using C(dconf), is not 100% reliable due to implementation details of D-Bus daemon itself. This might lead to running applications not picking-up changes on-the-fly if options are changed using Ansible and C(dbus-run-session). @@ -444,10 +448,12 @@ def main(): module.params["value"] = str(module.params["value"]) if Variant is None: - module.warn( - "WARNING: The gi.repository Python library is not available; " + module.deprecate( + "The gi.repository Python library is not available; " "using string comparison to check value equality. This fallback " - "will be deprecated in a future version of community.general." + "will be removed in community.general 15.0.0.", + version="15.0.0", + collection_name="community.general", ) deps.validate(module)