diff --git a/lib/ansible/module_utils/vmware.py b/lib/ansible/module_utils/vmware.py index 886994e535a..091f725d5dd 100644 --- a/lib/ansible/module_utils/vmware.py +++ b/lib/ansible/module_utils/vmware.py @@ -437,8 +437,10 @@ def list_snapshots(vm): result['snapshots'] = list_snapshots_recursively(vm.snapshot.rootSnapshotList) current_snapref = vm.snapshot.currentSnapshot current_snap_obj = get_current_snap_obj(vm.snapshot.rootSnapshotList, current_snapref) - result['current_snapshot'] = deserialize_snapshot_obj(current_snap_obj[0]) - + if current_snap_obj: + result['current_snapshot'] = deserialize_snapshot_obj(current_snap_obj[0]) + else: + result['current_snapshot'] = dict() return result