mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
CLOUDSTACK-5883 Improve error handling to get the real error
This commit is contained in:
parent
823abe6a23
commit
98e529af41
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user