From 9be37c03ba6296c07d9910079061542d8160a9fc Mon Sep 17 00:00:00 2001 From: Stan Bonev Date: Tue, 19 Mar 2019 15:19:35 -0400 Subject: RA: Fix Problems with resource query results Change-Id: Ic0fa65bff95ab5bd8ab65b055dcf7ec378e99d91 Issue-ID: CCSDK-1170 Signed-off-by: Stan Bonev --- .../org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocatorImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocatorImpl.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocatorImpl.java index ab73dab1..57796768 100644 --- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocatorImpl.java +++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/EndPointAllocatorImpl.java @@ -221,6 +221,9 @@ public class EndPointAllocatorImpl implements EndPointAllocator { List rlist = resourceManager.queryResources(resourceName, assetIdFilter); for (Resource r : rlist) { + if (r.allocationItems == null || r.allocationItems.isEmpty()) { + continue; + } log.info("ResourceName:" + r.resourceKey.resourceName + " assetId:" + r.resourceKey.assetId); @@ -252,7 +255,7 @@ public class EndPointAllocatorImpl implements EndPointAllocator { r = resourceManager.getResource(resourceName, assetId); } - if (r != null) { + if (r != null && r.allocationItems != null && !r.allocationItems.isEmpty()) { log.info("ResourceName:" + r.resourceKey.resourceName + " assetId:" + r.resourceKey.assetId); ResourceData rd = getResourceData(r); -- cgit 1.2.3-korg