Skip to content

Commit 67913b0

Browse files
committed
CSTACKEX-234: removing the storagemanagerimpl changes
1 parent b1f78c1 commit 67913b0

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,22 +1286,23 @@ public PrimaryDataStoreInfo updateStoragePool(UpdateStoragePoolCmd cmd) throws I
12861286
}
12871287

12881288
if (changes) {
1289-
DataStoreProvider dataStoreProvider = _dataStoreProviderMgr.getDataStoreProvider(pool.getStorageProviderName());
1289+
StoragePoolVO storagePool = _storagePoolDao.findById(id);
1290+
DataStoreProvider dataStoreProvider = _dataStoreProviderMgr.getDataStoreProvider(storagePool.getStorageProviderName());
12901291
DataStoreLifeCycle dataStoreLifeCycle = dataStoreProvider.getDataStoreLifeCycle();
1292+
12911293
if (dataStoreLifeCycle instanceof PrimaryDataStoreLifeCycle) {
12921294
if (updatedCapacityBytes != null) {
1293-
details.put(PrimaryDataStoreLifeCycle.CAPACITY_BYTES, String.valueOf(updatedCapacityBytes));
1294-
pool.setCapacityBytes(updatedCapacityBytes);
1295+
details.put(PrimaryDataStoreLifeCycle.CAPACITY_BYTES, updatedCapacityBytes != null ? String.valueOf(updatedCapacityBytes) : null);
1296+
_storagePoolDao.updateCapacityBytes(id, updatedCapacityBytes);
12951297
}
12961298
if (updatedCapacityIops != null) {
1297-
details.put(PrimaryDataStoreLifeCycle.CAPACITY_IOPS, String.valueOf(updatedCapacityIops));
1298-
pool.setCapacityIops(updatedCapacityIops);
1299+
details.put(PrimaryDataStoreLifeCycle.CAPACITY_IOPS, updatedCapacityIops != null ? String.valueOf(updatedCapacityIops) : null);
1300+
_storagePoolDao.updateCapacityIops(id, updatedCapacityIops);
12991301
}
13001302
if (cmd.getUrl() != null) {
13011303
details.put("url", cmd.getUrl());
13021304
}
1303-
((PrimaryDataStoreLifeCycle)dataStoreLifeCycle).updateStoragePool(pool, details);
1304-
_storagePoolDao.update(id, pool);
1305+
_storagePoolDao.update(id, storagePool);
13051306
_storagePoolDao.updateDetails(id, details);
13061307
}
13071308
}

0 commit comments

Comments
 (0)