VMware: Rename results key to ansible_module_results (#55038)

* Rename results key to ansible_module_results

* Update to a better variable name

* Update example and adds change to porting guide
pull/55096/head
Wilmar den Ouden 6 years ago committed by Abhijeet Kasurde
parent 72fc11ff13
commit 877ce12970

@ -0,0 +1,2 @@
bugfixes:
- The internal key `results` in vmware_guest_snapshot module return renamed to `snapshot_results`.

@ -304,6 +304,9 @@ Noteworthy module changes
* ``vmware_vm_facts`` used to return dict of dict with virtual machine's facts. Ansible 2.8 and onwards will return list of dict with virtual machine's facts.
Please see module ``vmware_vm_facts`` documentation for example.
* ``vmware_guest_snapshot`` module used to return ``results``. Since Ansible 2.8 and onwards ``results`` is a reserved keyword, it is replaced by ``snapshot_results``.
Please see module ``vmware_guest_snapshots`` documentation for example.
* The ``panos`` modules have been deprecated in favor of using the Palo Alto Networks `Ansible Galaxy role
<https://galaxy.ansible.com/PaloAltoNetworks/paloaltonetworks>`_. Contributions to the role can be made
`here <https://github.com/PaloAltoNetworks/ansible-pan>`_.

@ -218,11 +218,35 @@ EXAMPLES = '''
'''
RETURN = """
instance:
description: metadata about the new virtual machine snapshot
snapshot_results:
description: metadata about the virtual machine snapshots
returned: always
type: dict
sample: None
sample: {
"current_snapshot": {
"creation_time": "2019-04-09T14:40:26.617427+00:00",
"description": "Snapshot 4 example",
"id": 4,
"name": "snapshot4",
"state": "poweredOff"
},
"snapshots": [
{
"creation_time": "2019-04-09T14:38:24.667543+00:00",
"description": "Snapshot 3 example",
"id": 3,
"name": "snapshot3",
"state": "poweredOff"
},
{
"creation_time": "2019-04-09T14:40:26.617427+00:00",
"description": "Snapshot 4 example",
"id": 4,
"name": "snapshot4",
"state": "poweredOff"
}
]
}
"""
import time
@ -361,7 +385,7 @@ class PyVmomiHelper(PyVmomi):
if task.info.state == 'error':
result = {'changed': False, 'failed': True, 'msg': task.info.error.msg}
else:
result = {'changed': True, 'failed': False, 'results': list_snapshots(vm)}
result = {'changed': True, 'failed': False, 'snapshot_results': list_snapshots(vm)}
return result

Loading…
Cancel
Save