Skip to content
Merged
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 @@ -246,9 +246,13 @@
if (Objects.isNull(storagePool)) {
throw new CloudRuntimeException("Unable to find storage pool associated to the volume");
}
String volumePathPrefix = String.format("/mnt/%s", storagePool.getUuid());
String volumePathPrefix;
Copy link
Preview

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider initializing volumePathPrefix with a default value or restructuring the logic to avoid uninitialized variable concerns. While the current logic covers all cases, explicit initialization would improve code clarity.

Suggested change
String volumePathPrefix;
String volumePathPrefix = "";

Copilot uses AI. Check for mistakes.

if (ScopeType.HOST.equals(storagePool.getScope())) {
volumePathPrefix = storagePool.getPath();
} else if (Storage.StoragePoolType.SharedMountPoint.equals(storagePool.getPoolType())) {
volumePathPrefix = storagePool.getPath();

Check warning on line 253 in plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java

View check run for this annotation

Codecov / codecov/patch

plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java#L253

Added line #L253 was not covered by tests
} else {
volumePathPrefix = String.format("/mnt/%s", storagePool.getUuid());

Check warning on line 255 in plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java

View check run for this annotation

Codecov / codecov/patch

plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java#L255

Added line #L255 was not covered by tests
}
volumePaths.add(String.format("%s/%s", volumePathPrefix, volume.getPath()));
}
Expand Down
Loading