From 2f72b37cbbec5c81a039debfdfb13f707e176af9 Mon Sep 17 00:00:00 2001 From: "Boslet, Cory" Date: Wed, 19 Aug 2020 16:00:17 -0400 Subject: Need to create the ipv6 address which was missing. Need to create the ipv6 address which was missing. forgot to remove not needed line of code Updated junits to pass on jenkins. Updated unit test to test ipv6 ips. Issue-ID: SO-3186 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I58c643c0a4680fead44f84cb6ba2eca95d04cb72 --- .../main/java/org/onap/so/heatbridge/HeatBridgeImpl.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'adapters/mso-openstack-adapters/src/main/java') diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java index ef2577d6fe..37fef1aa64 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java @@ -49,6 +49,7 @@ import org.apache.commons.validator.routines.InetAddressValidator; import org.onap.aai.domain.yang.Flavor; import org.onap.aai.domain.yang.Image; import org.onap.aai.domain.yang.L3InterfaceIpv4AddressList; +import org.onap.aai.domain.yang.L3InterfaceIpv6AddressList; import org.onap.aai.domain.yang.L3Network; import org.onap.aai.domain.yang.LInterface; import org.onap.aai.domain.yang.PInterface; @@ -522,6 +523,20 @@ public class HeatBridgeImpl implements HeatBridgeApi { .cloudRegion(cloudOwner, cloudRegionId).tenant(tenantId).vserver(port.getDeviceId()) .lInterface(lIf.getInterfaceName()).l3InterfaceIpv4AddressList(ipAddress)), Optional.of(lInterfaceIp)); + } else if (InetAddressValidator.getInstance().isValidInet6Address(ipAddress)) { + Subnet subnet = osClient.getSubnetById(ip.getSubnetId()); + IPAddressString cidr = new IPAddressString(subnet.getCidr()); + L3InterfaceIpv6AddressList ipv6 = new L3InterfaceIpv6AddressList(); + ipv6.setL3InterfaceIpv6Address(ipAddress); + ipv6.setNeutronNetworkId(port.getNetworkId()); + ipv6.setNeutronSubnetId(ip.getSubnetId()); + ipv6.setL3InterfaceIpv6PrefixLength(Long.parseLong(cidr.getNetworkPrefixLength().toString())); + + transaction.createIfNotExists( + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure() + .cloudRegion(cloudOwner, cloudRegionId).tenant(tenantId).vserver(port.getDeviceId()) + .lInterface(lIf.getInterfaceName()).l3InterfaceIpv6AddressList(ipAddress)), + Optional.of(ipv6)); } } } -- cgit 1.2.3-korg