aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2020-08-06 09:46:40 +0000
committerGerrit Code Review <gerrit@onap.org>2020-08-06 09:46:40 +0000
commitcdc8d1abcb4aceeb44eacd5df3a5a0ba817c3318 (patch)
tree579e09cd286dc40eb3a719a4ec083148adfb2cce /adapters/mso-openstack-adapters
parent632458fa081692b68aa784b7941021f93fa5e401 (diff)
parent563f30382c8031b8d348b26be010dbe5fe91c55c (diff)
Merge "[SO] heatbridge implemention to delete L3Network and its subnet from AAI"
Diffstat (limited to 'adapters/mso-openstack-adapters')
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/HeatBridgeImpl.java14
1 files changed, 14 insertions, 0 deletions
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);