bugfix(VNFR): virtual storages added to VDU section inside the VNFR. bug 1511 08/11408/1 v9.0 v9.1.5
authorbravof <fbravo@whitestack.com>
Wed, 10 Nov 2021 20:58:58 +0000 (17:58 -0300)
committersousaedu <eduardo.sousa@canonical.com>
Wed, 24 Nov 2021 14:24:39 +0000 (14:24 +0000)
Change-Id: I60b33c5e4066545ba39e5dcaf1b7d9f27e6905d2
Signed-off-by: bravof <fbravo@whitestack.com>
Signed-off-by: sousaedu <eduardo.sousa@canonical.com>
osm_nbi/instance_topics.py

index 3626e53..07018c5 100644 (file)
@@ -573,7 +573,16 @@ class NsrTopic(BaseTopic):
                     vdu_mgmt_cp.append(ee["external-connection-point-ref"])
 
             additional_params, vdu_params = self._format_additional_params(
-                ns_request, vnf_index, vdu_id=vdu["id"], descriptor=vnfd)
+                ns_request, vnf_index, vdu_id=vdu["id"], descriptor=vnfd
+            )
+
+            try:
+                vdu_virtual_storage_descriptors = utils.filter_in_list(
+                    vnfd.get("virtual-storage-desc", []),
+                    lambda stg_desc: stg_desc["id"] in vdu["virtual-storage-desc"]
+                )
+            except Exception:
+                vdu_virtual_storage_descriptors = []
             vdur = {
                 "vdu-id-ref": vdu["id"],
                 # TODO      "name": ""     Name of the VDU in the VIM
@@ -582,7 +591,8 @@ class NsrTopic(BaseTopic):
                 "internal-connection-point": [],
                 "interfaces": [],
                 "additionalParams": additional_params,
-                "vdu-name": vdu["name"]
+                "vdu-name": vdu["name"],
+                "virtual-storages": vdu_virtual_storage_descriptors
             }
             if vdu_params and vdu_params.get("config-units"):
                 vdur["config-units"] = vdu_params["config-units"]