diff options
author | Steve Smokowski <ss835w@att.com> | 2019-02-11 13:08:42 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-02-11 13:08:42 +0000 |
commit | 9b0a912e6c618fe7d88ab55bd4208a4ba1bf986f (patch) | |
tree | 782b306e057c70072ff63f357935d6fdd9509bd5 | |
parent | 69b33c5a39c11992a26678a424723dafc521db5b (diff) | |
parent | d3c41cbc4998a64dac3548eb14f6b7fa476fd67c (diff) |
Merge "Remove resources that are not neutron networks"
-rw-r--r-- | adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java | 3 | ||||
-rw-r--r-- | adapters/mso-openstack-adapters/src/test/resources/GetResources.json | 24 |
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 +} |