X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Finstance_topics.py;h=ae4417a545894d1f6e23aae1737656c45ad3b840;hp=29a391cea3b1bc2fe7b1bea31f4a8acc51432b11;hb=e45aded97f406476e5f03d21f2624a092796f7f9;hpb=cc10343b861269fe9f336fadf54b8e9fba0a74a7 diff --git a/osm_nbi/instance_topics.py b/osm_nbi/instance_topics.py index 29a391c..ae4417a 100644 --- a/osm_nbi/instance_topics.py +++ b/osm_nbi/instance_topics.py @@ -132,7 +132,7 @@ class NsrTopic(BaseTopic): # Create VNFR needed_vnfds = {} - for member_vnf in nsd["constituent-vnfd"]: + for member_vnf in nsd.get("constituent-vnfd", ()): vnfd_id = member_vnf["vnfd-id-ref"] step = "getting vnfd id='{}' constituent-vnfd='{}' from database".format( member_vnf["vnfd-id-ref"], member_vnf["member-vnf-index"]) @@ -169,7 +169,7 @@ class NsrTopic(BaseTopic): # vim-id # TODO it would be nice having a vim port id } vnfr_descriptor["connection-point"].append(vnf_cp) - for vdu in vnfd["vdu"]: + for vdu in vnfd.get("vdu", ()): vdur = { "vdu-id-ref": vdu["id"], # TODO "name": "" Name of the VDU in the VIM