mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge release branch 4.18 to main
* 4.18: fix: cleanup directory if empty after removal of snapshot (#8002)
This commit is contained in:
commit
f70b42a018
@ -2076,6 +2076,13 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
|||||||
s_logger.warn(details);
|
s_logger.warn(details);
|
||||||
return new Answer(cmd, false, 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);
|
||||||
|
}
|
||||||
return new Answer(cmd, true, null);
|
return new Answer(cmd, true, null);
|
||||||
} else if (dstore instanceof S3TO) {
|
} else if (dstore instanceof S3TO) {
|
||||||
final S3TO s3 = (S3TO)dstore;
|
final S3TO s3 = (S3TO)dstore;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user