cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject git commit: updated refs/heads/4.3 to e49a60c
Date Thu, 16 Jan 2014 11:31:45 GMT
Updated Branches:
  refs/heads/4.3 ab0a068d9 -> e49a60c54


CLOUDSTACK-5883 Improve error handling to get the real error


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e49a60c5
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e49a60c5
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e49a60c5

Branch: refs/heads/4.3
Commit: e49a60c544bd877a1e206b305bb00984f0795738
Parents: ab0a068
Author: Hugo Trippaers <htrippaers@schubergphilis.com>
Authored: Thu Jan 16 12:31:14 2014 +0100
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Thu Jan 16 12:31:14 2014 +0100

----------------------------------------------------------------------
 .../hypervisor/vmware/mo/HypervisorHostHelper.java   | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e49a60c5/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
index cd2c3e8..3ba27d0 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
@@ -44,6 +44,7 @@ import com.vmware.vim25.HostVirtualSwitch;
 import com.vmware.vim25.HttpNfcLeaseDeviceUrl;
 import com.vmware.vim25.HttpNfcLeaseInfo;
 import com.vmware.vim25.HttpNfcLeaseState;
+import com.vmware.vim25.LocalizedMethodFault;
 import com.vmware.vim25.LongPolicy;
 import com.vmware.vim25.ManagedObjectReference;
 import com.vmware.vim25.ObjectContent;
@@ -66,6 +67,7 @@ import com.vmware.vim25.VmwareDistributedVirtualSwitchPvlanSpec;
 import com.vmware.vim25.VmwareDistributedVirtualSwitchVlanIdSpec;
 import com.vmware.vim25.VmwareDistributedVirtualSwitchVlanSpec;
 
+import com.cloud.exception.CloudException;
 import com.cloud.hypervisor.vmware.util.VmwareContext;
 import com.cloud.hypervisor.vmware.util.VmwareHelper;
 import com.cloud.network.Networks.BroadcastDomainType;
@@ -1332,6 +1334,19 @@ public class HypervisorHostHelper {
             throw new Exception(msg);
         }
 
+        if(!ovfImportResult.getError().isEmpty()) {
+            for (LocalizedMethodFault fault : ovfImportResult.getError()) {
+                s_logger.error("createImportSpec error: " + fault.getLocalizedMessage());
+            }
+            throw new CloudException("Failed to create an import spec from " + ovfFilePath
+ ". Check log for details.");
+        }
+
+        if (!ovfImportResult.getWarning().isEmpty()) {
+            for (LocalizedMethodFault fault : ovfImportResult.getError()) {
+                s_logger.warn("createImportSpec warning: " + fault.getLocalizedMessage());
+            }
+        }
+
         DatacenterMO dcMo = new DatacenterMO(context, host.getHyperHostDatacenter());
         ManagedObjectReference morLease = context.getService().importVApp(morRp,
                 ovfImportResult.getImportSpec(), dcMo.getVmFolder(), morHost);


Mime
View raw message