cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [28/50] [abbrv] git commit: updated refs/heads/rbac to 929fbab
Date Fri, 17 Jan 2014 22:40:30 GMT
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/98e529af
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/98e529af
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/98e529af

Branch: refs/heads/rbac
Commit: 98e529af41fa0a1f8ced6c674848e2130fbb0eb6
Parents: 823abe6
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 14:43:33 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/98e529af/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 9f5d4f9..2ddc144 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
@@ -68,6 +68,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;
@@ -1296,6 +1297,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);
         if (morLease == null) {


Mime
View raw message