Skip to content
Prev Previous commit
Next Next commit
fix logic to prevent take backup from failing
  • Loading branch information
Pearl1594 committed Feb 2, 2026
commit 101e2a0005ea387955c5a05eb41704e35ef69198
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,24 @@ private List<String> getVolumePaths(List<VolumeVO> volumes, List<Backup.VolumeIn
} else {
volumePathPrefix = String.format("/mnt/%s", storagePool.getUuid());
}
backedVolumes.stream().filter(backedVolume -> backedVolume.getUuid().equals(volume.getUuid())).findFirst()
.ifPresent(backedVolume -> {
boolean hasBackedVolumes = backedVolumes != null && !backedVolumes.isEmpty();
if (hasBackedVolumes) {
Optional<Backup.VolumeInfo> opt = backedVolumes.stream()
.filter(bv -> bv.getUuid().equals(volume.getUuid())).findFirst();
if (opt.isPresent()) {
Backup.VolumeInfo backedVolume = opt.get();
if (backedVolume.getPath() != null && !backedVolume.getPath().isEmpty()) {
volumePaths.add(String.format("%s/%s", volumePathPrefix, backedVolume.getPath()));
Comment thread
Pearl1594 marked this conversation as resolved.
Outdated
} else {
volumePaths.add(String.format("%s/%s", volumePathPrefix, volume.getPath()));
}
});
continue;
}
}

volumePaths.add(String.format("%s/%s", volumePathPrefix, volume.getPath()));
}

return volumePaths;
}

Expand Down
Loading