Skip to content

Commit 393eb6c

Browse files
committed
addressed review
1 parent 7777af2 commit 393eb6c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/datastore/util/StorPoolUtil.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ public static void spLog(String fmt, Object... args) {
138138

139139
public static final String SP_TIER = "SP_QOSCLASS";
140140

141+
public static final String OBJECT_DOES_NOT_EXIST = "objectDoesNotExist";
142+
141143
public static enum StorpoolRights {
142144
RO("ro"), RW("rw"), DETACH("detach");
143145

@@ -458,7 +460,7 @@ public static JsonArray templatesStats(SpConnectionDesc conn) {
458460
}
459461

460462
private static boolean objectExists(SpApiError err) {
461-
if (!err.getName().equals("objectDoesNotExist")) {
463+
if (!err.getName().equals(OBJECT_DOES_NOT_EXIST)) {
462464
throw new CloudRuntimeException(err.getDescr());
463465
}
464466
return false;

plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/snapshot/StorPoolSnapshotStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public boolean deleteSnapshot(Long snapshotId, Long zoneId) {
116116
if (resp.getError() != null) {
117117
final String err = String.format("Failed to clean-up Storpool snapshot %s. Error: %s", name, resp.getError());
118118
StorPoolUtil.spLog(err);
119-
markSnapshotAsDestroyedIfAlreadyRemoved(snapshotId, resp.getError().getName().equals("objectDoesNotExist"));
119+
markSnapshotAsDestroyedIfAlreadyRemoved(snapshotId, resp.getError().getName().equals(StorPoolUtil.OBJECT_DOES_NOT_EXIST));
120120
throw new CloudRuntimeException(err);
121121
} else {
122122
res = deleteSnapshotFromDbIfNeeded(snapshotVO, zoneId);

0 commit comments

Comments
 (0)