Unable to delete old service instances created of old ASDC service 51/117051/2
authorPATTANAYAK, SAUMYA SWARUP (sp931a) <sp931a@att.com>
Thu, 21 Jan 2021 20:48:04 +0000 (15:48 -0500)
committerIkram Ikramullah <ikram@research.att.com>
Tue, 2 Feb 2021 20:08:43 +0000 (20:08 +0000)
Issue-ID: VID-943
Change-Id: I3c395f5332f078ad1a9a2c2c6899d5edc8a6bec7
Signed-off-by: PATTANAYAK, SAUMYA SWARUP (sp931a) <sp931a@att.com>
vid-app-common/src/main/java/org/onap/vid/controller/AaiServiceInstanceStandardQueryController.java
vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java

index 015f8dc..c467d99 100644 (file)
@@ -139,6 +139,10 @@ public class AaiServiceInstanceStandardQueryController extends VidRestrictedBase
         if (serviceModel == null) {
             throw new GenericUncheckedException("Internal error while fetching Service Model: " + sdcModelUuid);
         }
+        if (serviceModel.getService() == null || serviceModel.getService().getVidNotions() == null) {
+            return false;
+        }
+
         VidNotions.ModelCategory serviceModelCategory = serviceModel.getService().getVidNotions().getModelCategory();
         return (serviceModelCategory == VidNotions.ModelCategory.IS_5G_PROVIDER_NETWORK_MODEL) ||
                 (serviceModelCategory == VidNotions.ModelCategory.IS_5G_FABRIC_CONFIGURATION_MODEL);
index ef62bf9..1870a00 100644 (file)
@@ -127,6 +127,7 @@ public class VidServiceImpl implements VidService {
         try {
             return serviceModelCache.get(uuid);
         } catch (ExecutionException e) {
+            LOG.error("Failed to get service info from cache ", e.getLocalizedMessage());
             if (e.getCause() instanceof AsdcCatalogException) {
                 throw (AsdcCatalogException) e.getCause();
             } else if (e.getCause() instanceof NullServiceModelException) {
@@ -155,6 +156,7 @@ public class VidServiceImpl implements VidService {
         try {
             return toscaParser.makeServiceModel(serviceCsar, asdcServiceMetadata);
         } catch (SdcToscaParserException e) {
+            LOG.error("Failed to create service model using sdc tosca library", e);
             return tosca.makeServiceModel(uuid, serviceCsar, asdcServiceMetadata);
         }
     }