aboutsummaryrefslogtreecommitdiffstats
path: root/onap-client
diff options
context:
space:
mode:
authorstark, steven <steven.stark@att.com>2020-06-15 11:57:43 -0700
committerstark, steven <steven.stark@att.com>2020-06-15 12:10:25 -0700
commite26c1462ae49699015764b3af2ba79def62234b9 (patch)
tree45aa53e213405ac5898cbf8b5ee9de1f75cf8b6c /onap-client
parent14df46b7b0166c05af9056ba71f1b6bac05e4f2d (diff)
[VVP] Enhance network role property handling
Issue-ID: VVP-421 Signed-off-by: stark, steven <steven.stark@att.com> Change-Id: I2af9206cbac62b33ce8373d3b480e16e1b2bbd1a
Diffstat (limited to 'onap-client')
-rw-r--r--onap-client/onap_client/sdc/tests/test_vnf.py2
-rw-r--r--onap-client/onap_client/sdc/vnf.py9
-rw-r--r--onap-client/setup.py2
3 files changed, 7 insertions, 6 deletions
diff --git a/onap-client/onap_client/sdc/tests/test_vnf.py b/onap-client/onap_client/sdc/tests/test_vnf.py
index f72043e..dfa5af1 100644
--- a/onap-client/onap_client/sdc/tests/test_vnf.py
+++ b/onap-client/onap_client/sdc/tests/test_vnf.py
@@ -195,4 +195,4 @@ def test_network_role_property_for_instance():
prop = network_role_property_for_instance("oam", vnf_model, "item1id")
- assert prop == "item1id.port123.oam.network_role"
+ assert "item1id.port123.oam.network_role" in prop
diff --git a/onap-client/onap_client/sdc/vnf.py b/onap-client/onap_client/sdc/vnf.py
index 80852a1..f1ccb51 100644
--- a/onap-client/onap_client/sdc/vnf.py
+++ b/onap-client/onap_client/sdc/vnf.py
@@ -273,10 +273,10 @@ class VNF(Resource):
nrt = network_role.get("network_role_tag")
nr = network_role.get("network_role")
related_networks = network_role.get("related_networks")
- instance_property = network_role_property_for_instance(
+ instance_properties = network_role_property_for_instance(
nrt, model, instance_id
)
- if instance_property:
+ for instance_property in instance_properties:
self.add_instance_property(instance_id, instance_property, nr)
if related_networks:
property_val = [
@@ -602,15 +602,16 @@ def network_role_property_for_instance(network_role_tag, vnf_model, instance_id)
:return: network_role property ID or None
"""
+ properties = []
instance_inputs = vnf_model.get("componentInstancesInputs", {}).get(instance_id, {})
for prop in instance_inputs:
if prop.get("name").endswith(
"network_role_tag"
) and network_role_tag == prop.get("value"):
network_role_property = prop.get("name").replace("_tag", "")
- return network_role_property
+ properties.append(network_role_property)
- return None
+ return properties
def add_resource(parent_resource_id, catalog_resource_id, catalog_resource_name, origin_type="VF"):
diff --git a/onap-client/setup.py b/onap-client/setup.py
index 8e4d9aa..c8f0fd9 100644
--- a/onap-client/setup.py
+++ b/onap-client/setup.py
@@ -47,7 +47,7 @@ for file in os.listdir("etc/payloads"):
setuptools.setup(
name="onap-client",
- version="0.6.3",
+ version="0.6.4",
author="Steven Stark",
author_email="steven.stark@att.com",
description="Python API wrapper for ONAP applications",