From cf5403afa3d5854809b06ce343775ac0b80e01e2 Mon Sep 17 00:00:00 2001 From: Tobias Smolka Date: Tue, 15 Dec 2015 12:45:51 +0100 Subject: [PATCH] Making cluster parameter optional --- lib/ansible/modules/cloud/vmware/vsphere_guest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/vmware/vsphere_guest.py b/lib/ansible/modules/cloud/vmware/vsphere_guest.py index 8e867e53ac1..d8d51c02ce8 100644 --- a/lib/ansible/modules/cloud/vmware/vsphere_guest.py +++ b/lib/ansible/modules/cloud/vmware/vsphere_guest.py @@ -653,7 +653,7 @@ def deploy_template(vsphere_client, guest, resource_pool, template_src, esxi, mo elif resource_pool: try: cluster = [k for k, - v in vsphere_client.get_clusters().items() if v == cluster_name][0] + v in vsphere_client.get_clusters().items() if v == cluster_name][0] if cluster_name else None except IndexError, e: vsphere_client.disconnect() module.fail_json(msg="Cannot find Cluster named: %s" % @@ -1056,7 +1056,7 @@ def create_vm(vsphere_client, module, esxi, resource_pool, cluster_name, guest, if resource_pool: try: cluster = [k for k, - v in vsphere_client.get_clusters().items() if v == cluster_name][0] + v in vsphere_client.get_clusters().items() if v == cluster_name][0] if cluster_name else None except IndexError, e: vsphere_client.disconnect() module.fail_json(msg="Cannot find Cluster named: %s" %