Proceed if no day 1 2 64/10564/1
authorbeierlm <mark.beierl@canonical.com>
Mon, 29 Mar 2021 20:03:37 +0000 (16:03 -0400)
committerbeierlm <mark.beierl@canonical.com>
Mon, 29 Mar 2021 20:03:37 +0000 (16:03 -0400)
Fixed bug where nf package build would fail if there are no day1-2 primitives
found.

Change-Id: I171e79683ad43537dc851ac05b8fb40f35cef903
Signed-off-by: beierlm <mark.beierl@canonical.com>
osmclient/common/package_tool.py

index e3dbd1a..3dedccd 100644 (file)
@@ -792,11 +792,12 @@ class PackageTool(object):
                 .get("operate-vnf-op-config", {})
                 .get("day1-2")
             )
-            for day_1_2 in day_1_2s:
-                exec_env_list = day_1_2.get("execution-environment-list", [])
-                for exec_env in exec_env_list:
-                    if "juju" in exec_env and "charm" in exec_env["juju"]:
-                        charms_list.append(exec_env["juju"]["charm"])
+            if day_1_2s is not None:
+                for day_1_2 in day_1_2s:
+                    exec_env_list = day_1_2.get("execution-environment-list", [])
+                    for exec_env in exec_env_list:
+                        if "juju" in exec_env and "charm" in exec_env["juju"]:
+                            charms_list.append(exec_env["juju"]["charm"])
         return charms_list
 
     def _charms_search_on_nsd_sol006_dict(self, sol006_dict):