mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-5828: if snapshot deletion failed, such as can't find it on secondary storage, should return succeed.
This commit is contained in:
parent
f79ba98cce
commit
8583b70f2a
|
|
@ -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()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 + "*";
|
||||
|
|
|
|||
Loading…
Reference in New Issue