VMware: Refactor vmware_host_facts (#39273)

* Updated documentation
* Error handling in find_obj
* Updated return facts example

Fixes: #39265

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2018-05-07 12:04:14 +05:30 committed by ansibot
parent 693065da1e
commit 0d29826e52
2 changed files with 130 additions and 91 deletions

View file

@ -1020,7 +1020,7 @@ class PyVmomi(object):
if not self.is_vcenter():
hosts = get_all_objs(self.content, [vim.HostSystem]).keys()
if hosts:
host_obj_list.append(hosts[0])
host_obj_list.append(list(hosts)[0])
else:
if cluster_name:
cluster_obj = self.find_cluster_by_name(cluster_name=cluster_name)