Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VMware: Rename results key to ansible_module_results #55038

Merged
merged 5 commits into from
Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- The internal key `results` in vmware_guest_snapshot module return renamed to `snapshot_results`.
3 changes: 3 additions & 0 deletions docs/docsite/rst/porting_guides/porting_guide_2.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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>`_.
Expand Down
32 changes: 28 additions & 4 deletions lib/ansible/modules/cloud/vmware/vmware_guest_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,35 @@
'''

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
Expand Down Expand Up @@ -361,7 +385,7 @@ def apply_snapshot_op(self, vm):
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

Expand Down