gconftool2: deprecate state get (#4778)

* gconftool2: deprecate state get

* added changelog fragment

* Update plugins/modules/system/gconftool2.py

* Update plugins/modules/system/gconftool2.py
pull/5027/head
Alexei Znamensky 2022-07-29 21:38:37 +12:00 committed by GitHub
parent 618fab5f9c
commit f544aac024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -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).

View File

@ -21,14 +21,14 @@ options:
type: str type: str
description: description:
- A GConf preference key is an element in the GConf repository - 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 required: yes
value: value:
type: str type: str
description: description:
- Preference keys typically have simple values such as strings, - Preference keys typically have simple values such as strings,
integers, or lists of strings and integers. This is ignored if the state 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: value_type:
type: str type: str
description: description:
@ -38,18 +38,19 @@ options:
type: str type: str
description: description:
- The action to take upon the key/value. - 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 required: yes
choices: [ absent, get, present ] choices: [ absent, get, present ]
config_source: config_source:
type: str type: str
description: description:
- Specify a configuration source to use rather than the default path. - Specify a configuration source to use rather than the default path.
See man gconftool-2(1) See man gconftool-2(1).
direct: direct:
description: description:
- Access the config database directly, bypassing server. If direct is - Access the config database directly, bypassing server. If direct is
specified then the config_source must be specified as well. specified then the config_source must be specified as well.
See man gconftool-2(1) See man gconftool-2(1).
type: bool type: bool
default: 'no' default: 'no'
''' '''
@ -119,6 +120,10 @@ class GConf2Preference(object):
# If the call is "get", then we don't need as many parameters and # If the call is "get", then we don't need as many parameters and
# we can ignore some # we can ignore some
if call_type == 'get': 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]) cmd.extend(["--get", self.key])
# Otherwise, we will use all relevant parameters # Otherwise, we will use all relevant parameters
elif call_type == 'set': elif call_type == 'set':