Skip to content

Commit ef5271b

Browse files
committed
fix for missing unmanaged vm name
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent f885ec1 commit ef5271b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/main/java/org/apache/cloudstack/ingestion/VmIngestionManagerImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,8 @@ public UserVmResponse importUnmanagedInstance(ImportUnmanageInstanceCmd cmd) {
434434
} catch (Exception e) {
435435
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Failed to import NICs while ingesting vm: %s. %s", instanceName, e.getMessage()));
436436
}
437+
} else {
438+
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Failed to ingest vm name: %s", instanceName));
437439
}
438440
break;
439441
}
@@ -443,7 +445,7 @@ public UserVmResponse importUnmanagedInstance(ImportUnmanageInstanceCmd cmd) {
443445
}
444446
}
445447
if (userVm == null) {
446-
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Failed to ingest vm name: %s", instanceName));
448+
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Failed to find unmanaged vm with name: %s", instanceName));
447449
}
448450
UserVmResponse response = responseGenerator.createUserVmResponse(ResponseObject.ResponseView.Full, "virtualmachine", userVm).get(0);
449451
return response;

0 commit comments

Comments
 (0)