Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport: core: Fail when getVolumeInfo fails during OVF read #903

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ protected void executeQueryCommand() {
// image. If there are multiple volumes, skip the image and move on to the next.
if (volumesList.size() != 1) {
getQueryReturnValue().setSucceeded(false);
log.info("Skipping a disk with snapshots: {}", diskId);

// Add context for why the query did not succeed. Not great, but it is what it is
DiskImage diskImage = new DiskImage();
diskImage.setDiskSnapshot(true);
diskImage.setDescription(String.format("snapshot-%s", diskId));
getQueryReturnValue().setReturnValue(diskImage);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ protected void executeQueryCommand() {
if (unregQueryReturn.getSucceeded()) {
unregisteredDisks.add(unregQueryReturn.getReturnValue());
} else {
log.debug("Could not get populated disk: {}", unregQueryReturn.getExceptionString());
DiskImage returnValue = unregQueryReturn.getReturnValue();
if (returnValue.isDiskSnapshot() &&
String.format("snapshot-%s", unregisteredDiskId).equals(returnValue.getDescription())) {
continue;
}

log.error("Could not get populated disk: {}", unregQueryReturn.getExceptionString());
getQueryReturnValue().setSucceeded(false);
}
}
getQueryReturnValue().setReturnValue(unregisteredDisks);
Expand Down