X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fdescriptor_topics.py;h=a1c3c15bfe4527c66bd003ff7e17d16f7ba000b8;hp=eef2ca435868101af2d860c93a23d02c1ed543f6;hb=1f1f6e03c7f6d6c1edd708e8d0b980827c7768ab;hpb=8ba4e0552fefc96856942fb524d903d286d1cb65;ds=sidebyside diff --git a/osm_nbi/descriptor_topics.py b/osm_nbi/descriptor_topics.py index eef2ca4..a1c3c15 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")):