From: delacruzramo Date: Thu, 28 Mar 2019 11:29:04 +0000 (+0100) Subject: Detection of duplicated VLD names in VNF Descriptors X-Git-Tag: v6.0.0~55 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=commitdiff_plain;h=5727a3717d0e3ce4dbb8d2aaec0589f0ba343ee2 Detection of duplicated VLD names in VNF Descriptors Change-Id: I3bea0ac4f36e110e4570ca6bc586d7af69ac226d Signed-off-by: delacruzramo --- diff --git a/osm_nbi/descriptor_topics.py b/osm_nbi/descriptor_topics.py index 94b74a9..9f022f4 100644 --- a/osm_nbi/descriptor_topics.py +++ b/osm_nbi/descriptor_topics.py @@ -527,7 +527,17 @@ class VnfdTopic(DescriptorTopic): if not self._validate_package_folders(storage_params, 'charms'): raise EngineException("Charm defined in vnf[id={}] but not present in " "package".format(indata["id"])) + vld_names = [] # For detection of duplicated VLD names for ivld in get_iterable(indata.get("internal-vld")): + # BEGIN Detection of duplicated VLD names + ivld_name = ivld["name"] + if ivld_name in vld_names: + raise EngineException("Duplicated VLD name '{}' in vnfd[id={}]:internal-vld[id={}]" + .format(ivld["name"], indata["id"], ivld["id"]), + http_code=HTTPStatus.UNPROCESSABLE_ENTITY) + else: + vld_names.append(ivld_name) + # END Detection of duplicated VLD names for icp in get_iterable(ivld.get("internal-connection-point")): icp_mark = False for vdu in get_iterable(indata.get("vdu")):