diff options
Diffstat (limited to 'adapters/mso-openstack-adapters')
-rw-r--r-- | adapters/mso-openstack-adapters/pom.xml | 2 | ||||
-rw-r--r-- | adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/adapters/mso-openstack-adapters/pom.xml b/adapters/mso-openstack-adapters/pom.xml index d78178f5ba..ad41b0f050 100644 --- a/adapters/mso-openstack-adapters/pom.xml +++ b/adapters/mso-openstack-adapters/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.onap.so</groupId> <artifactId>adapters</artifactId> - <version>1.6.0-SNAPSHOT</version> + <version>1.7.1-SNAPSHOT</version> </parent> <artifactId>mso-openstack-adapters</artifactId> <packaging>jar</packaging> 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 92958004ca..ef2577d6fe 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 @@ -552,6 +552,20 @@ public class HeatBridgeImpl implements HeatBridgeApi { Optional<Relationships> relationships = resultWrapper.getRelationships(); logger.debug("VfModule contains relationships in AAI: {}", relationships.isPresent()); if (relationships.isPresent()) { + + List<AAIResourceUri> l3NetworkUris = relationships.get().getRelatedUris(AAIObjectType.L3_NETWORK); + logger.debug("L3Network contains {} relationships in AAI", l3NetworkUris.size()); + + if (!l3NetworkUris.isEmpty()) { + for (AAIResourceUri l3NetworkUri : l3NetworkUris) { + if (env.getProperty("heatBridgeDryrun", Boolean.class, true)) { + logger.debug("Would delete L3Network: {}", l3NetworkUri.build().toString()); + } else { + resourcesClient.delete(l3NetworkUri); + } + } + } + List<AAIResourceUri> vserverUris = relationships.get().getRelatedUris(AAIObjectType.VSERVER); logger.debug("VServer contains {} relationships in AAI", vserverUris.size()); createTransactionToDeleteSriovPfFromPserver(vserverUris); |