diff options
author | 2017-05-25 20:29:43 +0300 | |
---|---|---|
committer | 2017-05-25 20:29:43 +0300 | |
commit | 2aed5c9968c48f665b85569333aa61011e611321 (patch) | |
tree | 89d369125093e7d621d795808679234f954f5c0f /sdc-tosca-parser/src/main | |
parent | 9e430cd9d4722c3e614c8a2fd822cff1604be1f2 (diff) |
[SDC-24] sdnc problems
Change-Id: I5bb5fd91ae1daf73fdf63cf8108531295bb8e96d
Signed-off-by: Pavel Aharoni <pa0916@att.com>
Diffstat (limited to 'sdc-tosca-parser/src/main')
-rw-r--r-- | sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java b/sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java index c53dcec..cf4806d 100644 --- a/sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java +++ b/sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java @@ -41,6 +41,7 @@ import org.openecomp.sdc.toscaparser.api.TopologyTemplate; import org.openecomp.sdc.toscaparser.api.ToscaTemplate; import org.openecomp.sdc.toscaparser.api.elements.Metadata; import org.openecomp.sdc.toscaparser.api.elements.NodeType; +import org.openecomp.sdc.toscaparser.api.functions.Function; import org.openecomp.sdc.toscaparser.api.parameters.Input; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -74,7 +75,7 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper { String[] split = getSplittedPath(leafValuePath); LinkedHashMap<String, Property> properties = nodeTemplate.getProperties(); Object property = processProperties(split, properties); - return property == null ? null : String.valueOf(property); + return property == null || property instanceof Function ? null : String.valueOf(property); } @Override @@ -124,11 +125,12 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper { String fullPathToSearch = PREFIX + cpName + "_" + item; Object value = getNodeTemplatePropertyAsObject(vfc, fullPathToSearch); if (value != null) { - if (!cps.containsKey(cpName)) + if (!cps.containsKey(cpName)){ cps.put(cpName, new HashMap<>()); + } + cps.get(cpName).put(item, value); } - cps.get(cpName).put(item, value); } } } @@ -250,7 +252,7 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper { Input input = findFirst.get(); Object current = input.getDefault(); Object property = iterateProcessPath(2, current, split); - return property == null ? null : String.valueOf(property); + return property == null || property instanceof Function? null : String.valueOf(property); } } log.error("getServiceInputLeafValue - value not found"); @@ -360,7 +362,7 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper { String[] split = getSplittedPath(leafValuePath); LinkedHashMap<String, Property> properties = group.getProperties(); Object property = processProperties(split, properties); - return property == null ? null : String.valueOf(property); + return property == null || property instanceof Function? null : String.valueOf(property); } @Override |