Skip to content

Commit 8583b70

Browse files
sudisonAnthony Xu
authored andcommitted
CLOUDSTACK-5828: if snapshot deletion failed, such as can't find it on secondary storage, should return succeed.
1 parent f79ba98 commit 8583b70

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ public boolean deleteSnapshotDirsForAccount(long accountId) {
599599
SnapshotDataStoreVO snapshotStoreRef = _snapshotStoreDao.findBySnapshot(snapshot.getId(), DataStoreRole.Image);
600600

601601
if (snapshotStrategy.deleteSnapshot(snapshot.getId())) {
602-
if (snapshot.getRecurringType() == Type.MANUAL) {
602+
if (Type.MANUAL == snapshot.getRecurringType()) {
603603
_resourceLimitMgr.decrementResourceCount(accountId, ResourceType.snapshot);
604604
_resourceLimitMgr.decrementResourceCount(accountId, ResourceType.secondary_storage, new Long(snapshotStoreRef.getSize()));
605605
}

services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,7 @@ protected Answer deleteSnapshot(final DeleteCommand cmd) {
12781278
if (!snapshotDir.exists()) {
12791279
details = "snapshot directory " + snapshotDir.getName() + " doesn't exist";
12801280
s_logger.debug(details);
1281-
return new Answer(cmd, false, details);
1281+
return new Answer(cmd, true, details);
12821282
}
12831283
// delete snapshot in the directory if exists
12841284
String lPath = absoluteSnapshotPath + "/*" + snapshotName + "*";

0 commit comments

Comments
 (0)