gluster_heal_facts: rename to gluster_heal_info (#60919)

* Rename gluster_heal_facts -> gluster_heal_info

* Add changelog.
This commit is contained in:
Felix Fontein 2019-08-20 15:43:41 +02:00 committed by GitHub
parent c66163b118
commit e58919bccd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 6 deletions

View file

@ -0,0 +1,3 @@
minor_changes:
- The ``gluster_heal_facts`` module has been renamed to ``gluster_heal_info``.
When called with the new name, the module no longer returns ``ansible_facts``.

View file

@ -239,6 +239,9 @@ be removed in Ansible 2.13. Please update update your playbooks accordingly.
* The ``gcp_tpu_node_facts`` module was renamed to :ref:`gcp_tpu_node_info <gcp_tpu_node_info_module>`.
* The ``gcpubsub_facts`` module was renamed to :ref:`gcpubsub_info <gcpubsub_info_module>`.
* The ``github_webhook_facts`` module was renamed to :ref:`github_webhook_info <github_webhook_info_module>`.
* The ``gluster_heal_facts`` module was renamed to :ref:`gluster_heal_info <gluster_heal_info_module>`.
When called with the new name, the module no longer returns ``ansible_facts``.
To access return values, :ref:`register a variable <registered_variables>`.
* The ``hpilo_facts`` module was renamed to :ref:`hpilo_info <hpilo_info_module>`.
When called with the new name, the module no longer returns ``ansible_facts``.
To access return values, :ref:`register a variable <registered_variables>`.

View file

@ -0,0 +1 @@
gluster_heal_info.py

View file

@ -14,12 +14,14 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: gluster_heal_facts
short_description: Gather facts about self-heal or rebalance status
module: gluster_heal_info
short_description: Gather information on self-heal or rebalance status
author: "Devyani Kota (@devyanikota)"
version_added: "2.8"
description:
- Gather facts about either self-heal or rebalance status.
- This module was called C(gluster_heal_facts) before Ansible 2.9, returning C(ansible_facts).
Note that the M(gluster_heal_info) module no longer returns C(ansible_facts)!
options:
name:
description:
@ -39,7 +41,7 @@ requirements:
EXAMPLES = '''
- name: Gather self-heal facts about all gluster hosts in the cluster
gluster_heal_facts:
gluster_heal_info:
name: test_volume
status_filter: self-heal
register: self_heal_status
@ -47,7 +49,7 @@ EXAMPLES = '''
var: self_heal_status
- name: Gather rebalance facts about all gluster hosts in the cluster
gluster_heal_facts:
gluster_heal_info:
name: test_volume
status_filter: rebalance
register: rebalance_status
@ -164,6 +166,10 @@ def main():
status_filter=dict(type='str', default='self-heal', choices=['self-heal', 'rebalance']),
),
)
is_old_facts = module._name == 'gluster_heal_facts'
if is_old_facts:
module.deprecate("The 'gluster_heal_facts' module has been renamed to 'gluster_heal_info', "
"and the renamed one no longer returns ansible_facts", version='2.13')
glusterbin = module.get_bin_path('gluster', True)
required_version = "3.2"
@ -188,7 +194,10 @@ def main():
facts = {}
facts['glusterfs'] = {'volume': volume_name, 'status_filter': status_filter, 'heal_info': heal_info, 'rebalance': rebalance_status}
module.exit_json(ansible_facts=facts)
if is_old_facts:
module.exit_json(ansible_facts=facts)
else:
module.exit_json(**facts)
if __name__ == '__main__':

View file

@ -5484,7 +5484,7 @@ lib/ansible/modules/source_control/subversion.py validate-modules:E322
lib/ansible/modules/source_control/subversion.py validate-modules:E337
lib/ansible/modules/storage/emc/emc_vnx_sg_member.py validate-modules:E337
lib/ansible/modules/storage/emc/emc_vnx_sg_member.py validate-modules:E338
lib/ansible/modules/storage/glusterfs/gluster_heal_facts.py validate-modules:E337
lib/ansible/modules/storage/glusterfs/gluster_heal_info.py validate-modules:E337
lib/ansible/modules/storage/glusterfs/gluster_peer.py validate-modules:E337
lib/ansible/modules/storage/glusterfs/gluster_volume.py validate-modules:E337
lib/ansible/modules/storage/ibm/ibm_sa_domain.py validate-modules:E338