File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 7575
7676public class HostMO extends BaseMO implements VmwareHypervisorHost {
7777 private static final Logger s_logger = Logger .getLogger (HostMO .class );
78- Map <String , VirtualMachineMO > _vmCache = new HashMap <String , VirtualMachineMO >();
78+ Map <String , VirtualMachineMO > _vmCache = new HashMap <>();
7979
8080 //Map<String, String> _vmInternalNameMapCache = new HashMap<String, String>();
8181
@@ -320,6 +320,11 @@ public AboutInfo getHostAboutInfo() throws Exception {
320320
321321 public VmwareHostType getHostType () throws Exception {
322322 AboutInfo aboutInfo = getHostAboutInfo ();
323+ if (aboutInfo == null ) {
324+ String msg = "no type info about host known, assuming ESXi" ;
325+ s_logger .warn (msg );
326+ return VmwareHostType .ESXi ;
327+ }
323328 if ("VMware ESXi" .equals (aboutInfo .getName ()))
324329 return VmwareHostType .ESXi ;
325330 else if ("VMware ESX" .equals (aboutInfo .getName ()))
You can’t perform that action at this time.
0 commit comments