Merge pull request #24324 from nmadhok/vmware-cloud-driver

Sometimes VMware tools status is unavailable so make sure not to fail with KeyError
This commit is contained in:
Joseph Hall 2015-06-02 08:15:58 -06:00
commit a273a9afd2

View File

@ -836,7 +836,7 @@ def _format_instance_info_select(vm, selection):
vm_select_info['path'] = vm["config.files.vmPathName"]
if 'tools_status' in selection:
vm_select_info['tools_status'] = str(vm["guest.toolsStatus"])
vm_select_info['tools_status'] = str(vm["guest.toolsStatus"]) if "guest.toolsStatus" in vm else "N/A"
if ('private_ips' or 'mac_address' or 'networks') in selection:
network_full_info = {}