summaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2019-02-08 17:40:25 -0500
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-02-08 17:42:55 -0500
commitd3c41cbc4998a64dac3548eb14f6b7fa476fd67c (patch)
treec89fc2443f0a6886de62fd1257b4cab34ce5230a /adapters
parentb3bc8b2a2cde4a72fae4d8f702b9fc87f6f138f1 (diff)
Remove resources that are not neutron networks
Remove resources that are not neutron networks Change-Id: Ie136895f95273e53f86201fe3b58a12fa27c8fe6 Issue-ID: SO-1486 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java3
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/GetResources.json24
2 files changed, 25 insertions, 2 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java
index 7bba136da2..974315374a 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java
@@ -162,7 +162,8 @@ public class HeatStackAudit {
auditVserver.setLInterfaces(new LInterfaces());
auditVserver.setVserverId(novaResource.getPhysicalResourceId());
Stream<Resource> filteredNeutronNetworks = resources.getList().stream()
- .filter(network -> network.getRequiredBy().contains(novaResource.getLogicalResourceId()));
+ .filter(resource -> resource.getRequiredBy().contains(novaResource.getLogicalResourceId()))
+ .filter(resource -> "OS::Neutron::Port".equals(resource.getType()));
filteredNeutronNetworks.forEach(network -> {
LInterface lInterface = new LInterface();
lInterface.setInterfaceId(network.getPhysicalResourceId());
diff --git a/adapters/mso-openstack-adapters/src/test/resources/GetResources.json b/adapters/mso-openstack-adapters/src/test/resources/GetResources.json
index 6e2bad38a4..22e66d41bb 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/GetResources.json
+++ b/adapters/mso-openstack-adapters/src/test/resources/GetResources.json
@@ -1,5 +1,27 @@
{
"resources": [
+ {
+ "links": [
+ {
+ "href": "https://orchestration.com:8004/v1/99cecb7b19dc4690960761abd0fe2413/stacks/zdyh3brlba05_addon/03840be2-7ce6-4e38-a748-dbd59a798732/resources/vlbagent_eph_aff_id",
+ "rel": "self"
+ },
+ {
+ "href": "https://orchestration.com:8004/v1/99cecb7b19dc4690960761abd0fe2413/stacks/zdyh3brlba05_addon/03840be2-7ce6-4e38-a748-dbd59a798732",
+ "rel": "stack"
+ }
+ ],
+ "logical_resource_id": "vlbagent_eph_aff_id",
+ "physical_resource_id": "zdyh3brlba05_addon-vlbagent_eph_aff_id-euhxoicxsgso",
+ "required_by": [
+ "ssc_server_1"
+ ],
+ "resource_name": "vlbagent_eph_aff_id",
+ "resource_status": "CREATE_COMPLETE",
+ "resource_status_reason": "state changed",
+ "resource_type": "OS::Heat::RandomString",
+ "updated_time": "2019-02-07T22:56:12Z"
+ },
{
"resource_name": "ssc_1_trusted_port_0",
"links": [
@@ -203,4 +225,4 @@
"resource_type": "OS::Heat::ResourceGroup"
}
]
-} \ No newline at end of file
+}