aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTal Gitelman <tal.gitelman@att.com>2019-01-02 15:34:04 +0200
committerTal Gitelman <tal.gitelman@att.com>2019-01-02 15:37:42 +0200
commit92208f69ec00a3f9d28a917d6f6a43ef150863dd (patch)
treedcf431c88ad1e3a6581995f41c5816199709d6b4
parent8e6ae20e9ae0a66c4f518f74d059e8cedf157693 (diff)
SDC distribution failed bug fix1.4.9
Change-Id: I5659511a6880201399173c941314cfc1d1bb7d22 Issue-ID: SDC-1955 Signed-off-by: Tal Gitelman <tal.gitelman@att.com>
-rw-r--r--pom.xml2
-rw-r--r--src/main/java/org/onap/sdc/toscaparser/api/elements/NodeType.java25
-rw-r--r--src/main/java/org/onap/sdc/toscaparser/api/utils/ValidateUtils.java2
-rw-r--r--version.properties2
4 files changed, 20 insertions, 11 deletions
diff --git a/pom.xml b/pom.xml
index 07e1c9f..8e6c0f8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
<groupId>org.onap.sdc.jtosca</groupId>
<artifactId>jtosca</artifactId>
- <version>1.4.8-SNAPSHOT</version>
+ <version>1.4.9-SNAPSHOT</version>
<name>sdc-jtosca</name>
<properties>
diff --git a/src/main/java/org/onap/sdc/toscaparser/api/elements/NodeType.java b/src/main/java/org/onap/sdc/toscaparser/api/elements/NodeType.java
index 07b3a87..a6d7f81 100644
--- a/src/main/java/org/onap/sdc/toscaparser/api/elements/NodeType.java
+++ b/src/main/java/org/onap/sdc/toscaparser/api/elements/NodeType.java
@@ -101,24 +101,33 @@ public class NodeType extends StatefulEntityType {
keyword = "node";
}
else {
- // If value is a dict and has a type key
+ String getRelation = null;
+ // If nodeTypeByCap is a dict and has a type key
// we need to lookup the node type using
// the capability type
String captype = (String)req.get("capability");
- String value = _getNodeTypeByCap(captype);
- String getRelation = _getRelation(key,value);
+ nodeType = _getNodeTypeByCap(captype);
+ if (nodeType != null){
+ getRelation = _getRelation(key, nodeType);
+ } else {
+ ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE11", String.format(
+ "NodeTypeForCapabilityNotFoundError: Node type for capability type \"%s\" is not found",captype)));
+ }
if (getRelation != null) {
relation = getRelation;
}
keyword = key;
- nodeType = value;
}
}
-
}
- RelationshipType rtype = new RelationshipType(relation, keyword, customDef);
- NodeType relatednode = new NodeType(nodeType, customDef);
- relationship.put(rtype, relatednode);
+ if(relation == null || nodeType == null){
+ ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE11", String.format(
+ "NodeTypeForRelationNotFound: Node type \"%s\" with relationship type \"%s\" is not found",nodeType, relation)));
+ } else {
+ RelationshipType rtype = new RelationshipType(relation, keyword, customDef);
+ NodeType relatednode = new NodeType(nodeType, customDef);
+ relationship.put(rtype, relatednode);
+ }
}
}
return relationship;
diff --git a/src/main/java/org/onap/sdc/toscaparser/api/utils/ValidateUtils.java b/src/main/java/org/onap/sdc/toscaparser/api/utils/ValidateUtils.java
index 6c26f18..9623258 100644
--- a/src/main/java/org/onap/sdc/toscaparser/api/utils/ValidateUtils.java
+++ b/src/main/java/org/onap/sdc/toscaparser/api/utils/ValidateUtils.java
@@ -12,7 +12,7 @@ public class ValidateUtils {
public static Object strToNum(Object value) {
// Convert a string representation of a number into a numeric type
- // tODO(TBD) we should not allow numeric values in, input should be str
+ // TODO(TBD) we should not allow numeric values in, input should be str
if(value instanceof Number) {
return value;
}
diff --git a/version.properties b/version.properties
index 7a72c98..61bae76 100644
--- a/version.properties
+++ b/version.properties
@@ -5,7 +5,7 @@
major=1
minor=4
-patch=8
+patch=9
base_version=${major}.${minor}.${patch}