GutoVeronezi commented on code in PR #8002:
URL: https://github.com/apache/cloudstack/pull/8002#discussion_r1337171922
##########
services/secondary-storage/server/src/main/java/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java:
##########
@@ -2050,6 +2050,14 @@ protected Answer deleteSnapshot(final DeleteCommand cmd)
{
s_logger.warn(details);
return new Answer(cmd, false, details);
}
+
+ // delete the directory if it is empty
+ if (snapshotDir.isDirectory() && snapshotDir.list().length == 0 &&
!snapshotDir.delete()) {
+ details = String.format("Unable to delete directory [%s]
at path [%s].", snapshotDir.getName(), snapshotPath);
+ s_logger.debug(details);
+ return new Answer(cmd, false, details);
+ }
+ }
Review Comment:
```suggestion
details = String.format("Unable to delete directory [%s] at
path [%s].", snapshotDir.getName(), snapshotPath);
s_logger.debug(details);
return new Answer(cmd, false, details);
}
```
@vishesh92, some adjusts are required because the previous suggestions were
directly applied.
--
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]