vishesh92 commented on code in PR #8002:
URL: https://github.com/apache/cloudstack/pull/8002#discussion_r1338029412


##########
services/secondary-storage/server/src/main/java/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java:
##########
@@ -2050,6 +2050,13 @@ 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:
   Agree. I used the code for volume & template deletion as reference. Should I 
also update this for them?



-- 
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]

Reply via email to