vmware: Fix bad ovf null error when registering template (#3511)

Fix template registration regression.
This commit is contained in:
Nicolas Vazquez 2019-07-24 03:07:25 -03:00 committed by Rohit Yadav
parent 6a511fce40
commit 2050a90ee8
1 changed files with 8 additions and 2 deletions

View File

@ -148,8 +148,14 @@ public class OVFHelper {
throw new CloudRuntimeException("The ovf file info has incomplete disk info");
}
Long capacity = cdisk == null ? of._size : cdisk._capacity;
String controller = cdisk == null ? "" : cdisk._controller._name;
String controllerSubType = cdisk == null ? "" : cdisk._controller._subType;
String controller = "";
String controllerSubType = "";
if (cdisk != null) {
OVFDiskController cDiskController = cdisk._controller;
controller = cDiskController == null ? "" : cdisk._controller._name;
controllerSubType = cDiskController == null ? "" : cdisk._controller._subType;
}
String dataDiskPath = ovfFile.getParent() + File.separator + of._href;
File f = new File(dataDiskPath);
if (!f.exists() || f.isDirectory()) {