diff options
author | Timoney, Dan (dt5972) <dtimoney@att.com> | 2018-10-24 15:33:39 -0400 |
---|---|---|
committer | Timoney, Dan (dt5972) <dtimoney@att.com> | 2018-10-24 15:33:39 -0400 |
commit | 0b54783bf2165af50a5b612c584a5a6243e00590 (patch) | |
tree | ca3f9cacda357f166953983a29df032e89345b24 | |
parent | bbb0c23a6ba5615e4b48b94f65930a0c69f44446 (diff) |
Fix handling of ip addresses
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>
-rw-r--r-- | sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java index f87b7d3c..9d25430f 100644 --- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java +++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java @@ -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, ""); |