From 0cacadb670b6359446dc7fba1130c4d800fd0664 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 --- cloud/vmware/vsphere_guest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/vmware/vsphere_guest.py b/cloud/vmware/vsphere_guest.py index f5507b331c2..3b03ec3da78 100644 --- a/cloud/vmware/vsphere_guest.py +++ b/cloud/vmware/vsphere_guest.py @@ -656,7 +656,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" % @@ -1059,7 +1059,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" %