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)
+ ivld_name = ivld.get("name")
+ if 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 in_ivld in get_iterable(in_vnfd.get("internal-vld")):
for ivld in get_iterable(vnfd.get("internal-vld")):
- if in_ivld["name"] == ivld["name"] or in_ivld["name"] == ivld["id"]:
+ if in_ivld["name"] in (ivld["id"], ivld.get("name")):
for in_icp in get_iterable(in_ivld.get("internal-connection-point")):
for icp in ivld["internal-connection-point"]:
if in_icp["id-ref"] == icp["id-ref"]: