mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-02-04 07:51:50 +00:00
[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 7f47deed64)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
2fa8179df2
commit
7c46b7edbc
2 changed files with 13 additions and 5 deletions
2
changelogs/fragments/11088-deprecate-dconf-fallback.yml
Normal file
2
changelogs/fragments/11088-deprecate-dconf-fallback.yml
Normal file
|
|
@ -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).
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue