Fix handling of ip addresses 78/71178/1
authorTimoney, Dan (dt5972) <dtimoney@att.com>
Wed, 24 Oct 2018 19:33:39 +0000 (15:33 -0400)
committerTimoney, Dan (dt5972) <dtimoney@att.com>
Wed, 24 Oct 2018 19:33:39 +0000 (15:33 -0400)
Fix handling of ietf inet classes (IpAddress, Ipv4Address, Ipv6Address).

Change-Id: Iaac7476236cfd42e6cc1f8b0640cc01946e932dc
Issue-ID: CCSDK-625
Signed-off-by: Timoney, Dan (dt5972) <dtimoney@att.com>
sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java

index f87b7d3..9d25430 100644 (file)
@@ -547,7 +547,7 @@ public class MdsalHelper {
 
             if (isYangGenerated(elemType)) {
                
-               if (isIpAddress(elemType) || isIpv4Address(elemType) || isIpv6Address(elemType)) {
+               if (isIpAddress(elemType)) {
 
                     String curValue = props.getProperty(curBase, "");
 
@@ -555,7 +555,24 @@ public class MdsalHelper {
                        toObj.add(IpAddressBuilder.getDefaultInstance(curValue));
                         foundValue = true;
                     }
-               } else if (isIpPrefix(elemType)) {
+               } else if (isIpv4Address(elemType)) {
+                    String curValue = props.getProperty(curBase, "");
+
+                    if ((curValue != null) && (curValue.length() > 0)) {
+                       toObj.add(new Ipv4Address(curValue));
+                        foundValue = true;
+                    }
+                       
+               } else if (isIpv6Address(elemType)) {
+                    String curValue = props.getProperty(curBase, "");
+
+                    if ((curValue != null) && (curValue.length() > 0)) {
+                       toObj.add(new Ipv6Address(curValue));
+                        foundValue = true;
+                    }
+               }
+               
+               else if (isIpPrefix(elemType)) {
 
                     String curValue = props.getProperty(curBase, "");