Bug 2108: Fix for editing polices in VNFD 21/12421/1
authorelumalai <deepika.e@tataelxsi.co.in>
Fri, 8 Jul 2022 06:36:27 +0000 (12:06 +0530)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 2 Aug 2022 10:22:33 +0000 (12:22 +0200)
Added fix for extracting policies from VNFD

Change-Id: I7bb55f32c4e5524030f92a0afed920e003a764bf
Signed-off-by: elumalai <deepika.e@tataelxsi.co.in>
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osm_nbi/descriptor_topics.py

index ddec65c..f28fcbf 100644 (file)
@@ -1223,7 +1223,14 @@ class VnfdTopic(DescriptorTopic):
         Returns:
             vnfd (dict): VNFD which does not include policies
         """
-        # TODO: Extract the policy related parts from the VNFD
+        for df in vnfd.get("df", {}):
+            for policy in ["scaling-aspect", "healing-aspect"]:
+                if (df.get(policy, {})):
+                    df.pop(policy)
+        for vdu in vnfd.get("vdu", {}):
+            for alarm_policy in ["alarm", "monitoring-parameter"]:
+                if (vdu.get(alarm_policy, {})):
+                    vdu.pop(alarm_policy)
         return vnfd
 
     @staticmethod