From: elumalai Date: Fri, 8 Jul 2022 06:36:27 +0000 (+0530) Subject: Bug 2108: Fix for editing polices in VNFD X-Git-Tag: v12.0.1^0 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=90e2c6b2c22748d9b476173c1792addeac3fc604;p=osm%2FNBI.git Bug 2108: Fix for editing polices in VNFD Added fix for extracting policies from VNFD Change-Id: I7bb55f32c4e5524030f92a0afed920e003a764bf Signed-off-by: elumalai --- diff --git a/osm_nbi/descriptor_topics.py b/osm_nbi/descriptor_topics.py index ddec65c..f28fcbf 100644 --- a/osm_nbi/descriptor_topics.py +++ b/osm_nbi/descriptor_topics.py @@ -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