sureshanaparti commented on code in PR #8653:
URL: https://github.com/apache/cloudstack/pull/8653#discussion_r1492518286
##########
plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/util/LinstorUtil.java:
##########
@@ -107,13 +107,23 @@ public static List<String> getLinstorNodeNames(@Nonnull
DevelopersApi api) throw
}
List<com.linbit.linstor.api.model.StoragePool> sps =
api.viewStoragePools(
- Collections.singletonList(nodeName),
- Collections.singletonList(storagePoolName),
- Collections.emptyList(),
- null,
- null
+ Collections.singletonList(nodeName),
+ Collections.singletonList(storagePoolName),
+ Collections.emptyList(),
+ null,
+ null
);
- return !sps.isEmpty() ? sps.get(0) : null;
+ return sps != null ? sps : Collections.emptyList();
+ }
+
+ public static com.linbit.linstor.api.model.StoragePool
+ getDiskfulStoragePool(@Nonnull DevelopersApi api, @Nonnull String rscName)
throws ApiException
+ {
+ List<com.linbit.linstor.api.model.StoragePool> sps =
getDiskfulStoragePools(api, rscName);
+ if (sps != null) {
Review Comment:
```suggestion
if (sps != null && !sps.isEmpty()) {
```
or use _CollectionUtils.isNotEmpty(sps)_
and
`return sps.get(0)`
--
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]