rohityadavcloud commented on code in PR #7524:
URL: https://github.com/apache/cloudstack/pull/7524#discussion_r1192510471
##########
services/secondary-storage/server/src/main/java/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java:
##########
@@ -1997,6 +1997,17 @@ private void savePostUploadPSK(String psk) {
}
}
+ protected String getSnapshotFilepathForDelete(String path, String
snapshotName) {
+ String finalPath = path + "/*" + snapshotName + "*";
+ if (!path.endsWith(snapshotName)) {
+ return finalPath;
+ }
+ if (s_logger.isDebugEnabled()) {
+ s_logger.debug(String.format("Snapshot file %s is present in the
same name directory %s. Deleting the directory", snapshotName, path));
+ }
+ return path;
+ }
Review Comment:
I suppose we need to cover both cases, to check if we're deleting files
inside a folder (like in vmware), but also for kvm where snapshots arne't in a
folder. XenServer/XCP-ng we need to check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]