From aaef31359e37a5f93f347dd5989424bf37d0b8f9 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky <103110+russoz@users.noreply.github.com> Date: Fri, 29 Jul 2022 21:38:37 +1200 Subject: [PATCH] gconftool2: deprecate state get (#4778) * gconftool2: deprecate state get * added changelog fragment * Update plugins/modules/system/gconftool2.py * Update plugins/modules/system/gconftool2.py --- .../4778-gconftool2-deprecate-state-get.yaml | 2 ++ plugins/modules/system/gconftool2.py | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/4778-gconftool2-deprecate-state-get.yaml diff --git a/changelogs/fragments/4778-gconftool2-deprecate-state-get.yaml b/changelogs/fragments/4778-gconftool2-deprecate-state-get.yaml new file mode 100644 index 00000000000..55d88699362 --- /dev/null +++ b/changelogs/fragments/4778-gconftool2-deprecate-state-get.yaml @@ -0,0 +1,2 @@ +deprecated_features: + - gconftool2 - deprecates ``state=get`` in favor of using the module ``gconftool2_info`` (https://github.com/ansible-collections/community.general/pull/4778). diff --git a/plugins/modules/system/gconftool2.py b/plugins/modules/system/gconftool2.py index 86bb2f92597..1fcc9b7231d 100644 --- a/plugins/modules/system/gconftool2.py +++ b/plugins/modules/system/gconftool2.py @@ -21,14 +21,14 @@ type: str description: - A GConf preference key is an element in the GConf repository - that corresponds to an application preference. See man gconftool-2(1) + that corresponds to an application preference. See man gconftool-2(1). required: yes value: type: str description: - Preference keys typically have simple values such as strings, integers, or lists of strings and integers. This is ignored if the state - is "get". See man gconftool-2(1) + is "get". See man gconftool-2(1). value_type: type: str description: @@ -38,18 +38,19 @@ type: str description: - The action to take upon the key/value. + - State C(get) is deprecated and will be removed in community.general 8.0.0. Please use the module M(community.general.gconftool2_info) instead. required: yes choices: [ absent, get, present ] config_source: type: str description: - Specify a configuration source to use rather than the default path. - See man gconftool-2(1) + See man gconftool-2(1). direct: description: - Access the config database directly, bypassing server. If direct is specified then the config_source must be specified as well. - See man gconftool-2(1) + See man gconftool-2(1). type: bool default: 'no' ''' @@ -119,6 +120,10 @@ def call(self, call_type, fail_onerr=True): # If the call is "get", then we don't need as many parameters and # we can ignore some if call_type == 'get': + self.ansible.deprecate( + msg="State 'get' is deprecated. Please use the module community.general.gconftool2_info instead", + version="8.0.0", collection_name="community.general" + ) cmd.extend(["--get", self.key]) # Otherwise, we will use all relevant parameters elif call_type == 'set':