Skip to content

Commit ecffe53

Browse files
review comments
1 parent 78c44ef commit ecffe53

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

server/src/main/java/com/cloud/storage/StorageManagerImpl.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,23 +2028,16 @@ private void deleteSnapshot(SnapshotVO snapshot, SnapshotDataStoreVO snapshotDat
20282028
try {
20292029
final String snapshotUuid = snapshot.getUuid();
20302030
final String storeRole = snapshotDataStoreVO.getRole().toString().toLowerCase();
2031-
if (logger.isDebugEnabled()) {
2032-
logger.debug("Snapshot [{}] is in {} state on {} data store ID: {}.", snapshotUuid, snapshotDataStoreVO.getState(), storeRole, snapshotDataStoreVO.getDataStoreId());
2033-
}
2031+
logger.debug("Snapshot [{}] is in {} state on {} data store ID: {}.", snapshotUuid, snapshotDataStoreVO.getState(), storeRole, snapshotDataStoreVO.getDataStoreId());
20342032
SnapshotInfo snapshotInfo = snapshotFactory.getSnapshotIncludingRemoved(snapshotDataStoreVO.getSnapshotId(), snapshotDataStoreVO.getDataStoreId(), snapshotDataStoreVO.getRole());
20352033
if (snapshotInfo != null) {
2036-
if (logger.isDebugEnabled()) {
2037-
logger.debug("Snapshot [{}] in {} state found on {} data store [{}], it will be deleted.", snapshotUuid, snapshotDataStoreVO.getState(), storeRole, snapshotInfo.getDataStore().getUuid());
2038-
}
2034+
logger.debug("Snapshot [{}] in {} state found on {} data store [{}], it will be deleted.", snapshotUuid, snapshotDataStoreVO.getState(), storeRole, snapshotInfo.getDataStore().getUuid());
20392035
_snapshotService.deleteSnapshot(snapshotInfo);
2040-
} else if (logger.isDebugEnabled()) {
2036+
} else {
20412037
logger.debug("Did not find snapshot [{}] in {} state on {} data store ID: {}.", snapshotUuid, snapshotDataStoreVO.getState(), storeRole, snapshotDataStoreVO.getDataStoreId());
20422038
}
20432039
} catch (Exception e) {
2044-
logger.error("Failed to delete snapshot [{}] from storage due to: [{}].", snapshot, e.getMessage());
2045-
if (logger.isDebugEnabled()) {
2046-
logger.debug("Failed to delete snapshot [{}] from storage.", snapshot, e);
2047-
}
2040+
logger.error("Failed to delete snapshot [{}] from storage due to: [{}].", snapshot, e.getMessage(), e);
20482041
}
20492042
}
20502043

0 commit comments

Comments
 (0)