Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 34F8A10F1B for ; Thu, 16 Jan 2014 13:44:03 +0000 (UTC) Received: (qmail 7154 invoked by uid 500); 16 Jan 2014 13:44:02 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 5493 invoked by uid 500); 16 Jan 2014 13:43:58 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 5320 invoked by uid 99); 16 Jan 2014 13:43:55 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jan 2014 13:43:55 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id CFEC6835686; Thu, 16 Jan 2014 13:43:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hugo@apache.org To: commits@cloudstack.apache.org Date: Thu, 16 Jan 2014 13:43:54 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: updated refs/heads/master to 794d47c Updated Branches: refs/heads/master 823abe6a2 -> 794d47c5f 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/master Commit: 98e529af41fa0a1f8ced6c674848e2130fbb0eb6 Parents: 823abe6 Author: Hugo Trippaers Authored: Thu Jan 16 12:31:14 2014 +0100 Committer: Hugo Trippaers 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) {