From: bravof Date: Thu, 22 Apr 2021 14:03:02 +0000 (-0400) Subject: fix(vdu): vdu number of instances now is taking into account. Bug 1477 X-Git-Tag: release-v10.0-start~5 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=4ca5152329fcba2f575085df9c0921f6d1135020;p=osm%2FNBI.git fix(vdu): vdu number of instances now is taking into account. Bug 1477 Change-Id: I63c5281cd5c9d935d51d1f1ace27fea782e84b4c Signed-off-by: bravof --- diff --git a/osm_nbi/instance_topics.py b/osm_nbi/instance_topics.py index bf0e3a9..84ba177 100644 --- a/osm_nbi/instance_topics.py +++ b/osm_nbi/instance_topics.py @@ -550,7 +550,15 @@ class NsrTopic(BaseTopic): vdu_config = utils.find_in_list(configs, lambda config: config["id"] == vdu["id"]) except Exception: vdu_config = None - + + try: + vdu_instantiation_level = utils.find_in_list( + vnfd.get("df")[0]["instantiation-level"][0]["vdu-level"], + lambda a_vdu_profile: a_vdu_profile["vdu-id"] == vdu["id"] + ) + except Exception: + vdu_instantiation_level = None + if vdu_config: external_connection_ee = utils.filter_in_list( vdu_config.get("execution-environment-list", []), @@ -689,7 +697,11 @@ class NsrTopic(BaseTopic): if nsr_flavor_desc: vdur["ns-flavor-id"] = nsr_flavor_desc["id"] - count = int(vdu.get("count", 1)) + if vdu_instantiation_level: + count = vdu_instantiation_level.get("number-of-instances") + else: + count = 1 + for index in range(0, count): vdur = deepcopy(vdur) for iface in vdur["interfaces"]: