Bug 2068 - show_content_artifacts error for zip uploaded packages (sol004 and sol007) 89/12489/2
authorselvi.j <selvi.j@tataelxsi.co.in>
Thu, 25 Aug 2022 06:24:49 +0000 (06:24 +0000)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 20 Sep 2022 13:20:59 +0000 (15:20 +0200)
NG-UI throws an error while clicking content button inside action dropdown
For zip based onboarded packages (sol004 and sol007), facing issues while retrieving the file contents from NG-UI.

API used: /osm/vnfpkgm/v1/vnf_packages/<id>/artifacts

Error detail: Packages does not contains artifacts

Changes made: Zip based packages will check for the folder name, if it doesn't have folder name,
then it will raise the exception else it will pass and print the required output.

Change-Id: I0e6ea93a37162a646ddf2a08103d2a99791a8777
Signed-off-by: selvi.j <selvi.j@tataelxsi.co.in>
osm_nbi/descriptor_topics.py

index f28fcbf..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,