summaryrefslogtreecommitdiffstats
path: root/adapters/mso-catalog-db-adapter/src/main
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2019-01-24 17:00:09 +0530
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2019-01-24 17:00:09 +0530
commit1d602253b5a2a0dde15c672875515619460337bd (patch)
treed1dbdd3137c1c0b7c199b53c3366a82807100f4c /adapters/mso-catalog-db-adapter/src/main
parent402f8dc916e938a55dd54f721b3ce3928a7409a0 (diff)
Fix AR receipe retrival
Fix AR receipe retrival. Change-Id: I5675fef17c1ee6375dd6c68a311d5f0568438879 Issue-ID: SO-1422 Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src/main')
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java
index 9bcbe16af2..dbb168bd15 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java
@@ -588,17 +588,22 @@ public class CatalogDbAdapterRest {
if (null == recipe) {
NetworkResource nResource = networkResourceRepo.findResourceByModelUUID(rmUuid);
- recipe = networkRecipeRepo.findFirstByModelNameAndActionAndVersionStr(nResource.getModelName(), action, nResource.getModelVersion());
- // for network fetch the default recipe
- if (recipe == null) {
- recipe = networkRecipeRepo.findFirstByModelNameAndAction("SDNC_DEFAULT", action);
+ if(nResource != null) {
+ recipe = networkRecipeRepo.findFirstByModelNameAndActionAndVersionStr(nResource.getModelName(), action, nResource.getModelVersion());
+
+ // for network fetch the default recipe
+ if (recipe == null) {
+ recipe = networkRecipeRepo.findFirstByModelNameAndAction("SDNC_DEFAULT", action);
+ }
}
}
if (null == recipe) {
AllottedResource arResource = arResourceRepo.findResourceByModelUUID(rmUuid);
- recipe = arRecipeRepo.findByModelNameAndActionAndVersion(arResource.getModelName(), action, arResource.getModelVersion());
+ if (arResource != null) {
+ recipe = arRecipeRepo.findByModelNameAndActionAndVersion(arResource.getModelName(), action, arResource.getModelVersion());
+ }
}
if (recipe != null) {
QueryResourceRecipe resourceRecipe = new QueryResourceRecipe(recipe);