Bug 2068 - show_content_artifacts error for zip uploaded packages (sol004 and sol007)
[osm/NBI.git] / osm_nbi / descriptor_topics.py
index ddec65c..ddf8ffc 100644 (file)
@@ -568,7 +568,7 @@ class DescriptorTopic(BaseTopic):
             )
         storage = content["_admin"]["storage"]
         if path is not None and path != "$DESCRIPTOR":  # artifacts
-            if not storage.get("pkg-dir"):
+            if not storage.get("pkg-dir") and not storage.get("folder"):
                 raise EngineException(
                     "Packages does not contains artifacts",
                     http_code=HTTPStatus.BAD_REQUEST,
@@ -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