CLOUDSTACK-5828: if snapshot deletion failed, such as can't find it on secondary storage, should return succeed.

This commit is contained in:
edison 2014-01-08 14:35:15 -08:00 committed by Anthony Xu
parent f79ba98cce
commit 8583b70f2a
2 changed files with 2 additions and 2 deletions

View File

@ -599,7 +599,7 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
SnapshotDataStoreVO snapshotStoreRef = _snapshotStoreDao.findBySnapshot(snapshot.getId(), DataStoreRole.Image);
if (snapshotStrategy.deleteSnapshot(snapshot.getId())) {
if (snapshot.getRecurringType() == Type.MANUAL) {
if (Type.MANUAL == snapshot.getRecurringType()) {
_resourceLimitMgr.decrementResourceCount(accountId, ResourceType.snapshot);
_resourceLimitMgr.decrementResourceCount(accountId, ResourceType.secondary_storage, new Long(snapshotStoreRef.getSize()));
}

View File

@ -1278,7 +1278,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
if (!snapshotDir.exists()) {
details = "snapshot directory " + snapshotDir.getName() + " doesn't exist";
s_logger.debug(details);
return new Answer(cmd, false, details);
return new Answer(cmd, true, details);
}
// delete snapshot in the directory if exists
String lPath = absoluteSnapshotPath + "/*" + snapshotName + "*";