From d3c41cbc4998a64dac3548eb14f6b7fa476fd67c Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Fri, 8 Feb 2019 17:40:25 -0500 Subject: 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) --- .../org/onap/so/adapters/audit/HeatStackAudit.java | 3 ++- .../src/test/resources/GetResources.json | 24 +++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) (limited to 'adapters/mso-openstack-adapters') 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 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 +} -- cgit 1.2.3-korg