From c554733ede49bd0be16c5a665577ce2a32bae565 Mon Sep 17 00:00:00 2001 From: Ramya Balaji Date: Mon, 15 Jan 2018 11:02:37 -0500 Subject: Improved logging,error handling-VM capabilities Code corrections for graceful failure, added info log statements Issue-ID: APPC-409 Change-Id: Ibae80a4392508d1de5e68933beed048ff6ae016d Signed-off-by: Ramya Balaji --- .../onap/appc/data/services/node/ConfigResourceNode.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'appc-config') diff --git a/appc-config/appc-data-services/provider/src/main/java/org/onap/appc/data/services/node/ConfigResourceNode.java b/appc-config/appc-data-services/provider/src/main/java/org/onap/appc/data/services/node/ConfigResourceNode.java index a9d3dbb8f..30fcbbdcc 100644 --- a/appc-config/appc-data-services/provider/src/main/java/org/onap/appc/data/services/node/ConfigResourceNode.java +++ b/appc-config/appc-data-services/provider/src/main/java/org/onap/appc/data/services/node/ConfigResourceNode.java @@ -748,6 +748,12 @@ public class ConfigResourceNode implements SvcLogicJavaPlugin { } String vnfcFunctionCode = getVnfcFunctionCodeForVserver(ctx, vServerId); + if (StringUtils.isBlank(vnfcFunctionCode)) { + log.info("processCapabilitiesForVMLevel() :: vnfcFunctionCode is not present in context!!!"); + ctx.setAttribute("capabilities", "Not-Supported"); + return; + } + if (vmCaps.toString().contains(vnfcFunctionCode)) ctx.setAttribute("capabilities", "Supported"); else @@ -756,9 +762,15 @@ public class ConfigResourceNode implements SvcLogicJavaPlugin { } private String getVnfcFunctionCodeForVserver(SvcLogicContext ctx, String vServerId) throws Exception { - log.debug("getVnfcFunctionCodeForVserver()::vServerId=" + vServerId); + log.info("getVnfcFunctionCodeForVserver()::vServerId=" + vServerId); + for (Object key : ctx.getAttributeKeySet()) { + String parmName = (String) key; + String parmValue = ctx.getAttribute(parmName); + log.info(parmName + "=" + parmValue); + + } String vnfcFunctionCode = ctx.getAttribute("tmp.vnfInfo.vm.vnfc.vnfc-function-code"); - log.debug("getVnfcFunctionCodeForVserver()::vnfcFunctionCode=" + vnfcFunctionCode); + log.info("getVnfcFunctionCodeForVserver()::vnfcFunctionCode=" + vnfcFunctionCode); return vnfcFunctionCode; } -- cgit 1.2.3-korg