Skip to content

Commit 2050a90

Browse files
nvazquezyadvr
authored andcommitted
vmware: Fix bad ovf null error when registering template (#3511)
Fix template registration regression.
1 parent 6a511fc commit 2050a90

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

api/src/main/java/com/cloud/agent/api/storage/OVFHelper.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,14 @@ public List<DatadiskTO> getOVFVolumeInfo(final String ovfFilePath) {
148148
throw new CloudRuntimeException("The ovf file info has incomplete disk info");
149149
}
150150
Long capacity = cdisk == null ? of._size : cdisk._capacity;
151-
String controller = cdisk == null ? "" : cdisk._controller._name;
152-
String controllerSubType = cdisk == null ? "" : cdisk._controller._subType;
151+
String controller = "";
152+
String controllerSubType = "";
153+
if (cdisk != null) {
154+
OVFDiskController cDiskController = cdisk._controller;
155+
controller = cDiskController == null ? "" : cdisk._controller._name;
156+
controllerSubType = cDiskController == null ? "" : cdisk._controller._subType;
157+
}
158+
153159
String dataDiskPath = ovfFile.getParent() + File.separator + of._href;
154160
File f = new File(dataDiskPath);
155161
if (!f.exists() || f.isDirectory()) {

0 commit comments

Comments
 (0)