You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2019/07/24 06:07:42 UTC

[cloudstack] branch master updated: vmware: Fix bad ovf null error when registering template (#3511)

This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/master by this push:
     new 2050a90  vmware: Fix bad ovf null error when registering template (#3511)
2050a90 is described below

commit 2050a90ee8665931661b3c5cd84b49572119842e
Author: Nicolas Vazquez <ni...@gmail.com>
AuthorDate: Wed Jul 24 03:07:25 2019 -0300

    vmware: Fix bad ovf null error when registering template (#3511)
    
    Fix template registration regression.
---
 api/src/main/java/com/cloud/agent/api/storage/OVFHelper.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/api/src/main/java/com/cloud/agent/api/storage/OVFHelper.java b/api/src/main/java/com/cloud/agent/api/storage/OVFHelper.java
index 85d4030..389800b 100644
--- a/api/src/main/java/com/cloud/agent/api/storage/OVFHelper.java
+++ b/api/src/main/java/com/cloud/agent/api/storage/OVFHelper.java
@@ -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()) {