sureshanaparti commented on code in PR #11817:
URL: https://github.com/apache/cloudstack/pull/11817#discussion_r2708395294
##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1558,14 +1558,18 @@ private boolean deleteDataStoreInternal(StoragePoolVO
sPool, boolean forced) {
protected String getStoragePoolNonDestroyedVolumesLog(long storagePoolId) {
StringBuilder sb = new StringBuilder();
- List<VolumeVO> nonDestroyedVols =
volumeDao.findByPoolId(storagePoolId, null).stream().filter(vol ->
vol.getState() != Volume.State.Destroy).collect(Collectors.toList());
+ List<VolumeVO> nonDestroyedVols =
volumeDao.findByPoolId(storagePoolId, null);
VMInstanceVO volInstance;
List<String> logMessageInfo = new ArrayList<>();
sb.append("[");
for (VolumeVO vol : nonDestroyedVols) {
volInstance = _vmInstanceDao.findById(vol.getInstanceId());
Review Comment:
_vol.getInstanceId()_ is null for detached volumes, calling dao may not be
needed (anyways, it returns null).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]