fix(juju): honor juju changes in descriptor 20/10420/1 branch-bug1511-start v9.1.0 v9.1.1 v9.1.1rc1
authorbravof <fbravo@whitestack.com>
Mon, 22 Feb 2021 21:00:48 +0000 (18:00 -0300)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 2 Mar 2021 09:50:49 +0000 (09:50 +0000)
Change-Id: Ia2e8de3d7f50b164c386e4bef263c2e851cd2bc0
Signed-off-by: bravof <fbravo@whitestack.com>
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osmclient/common/package_tool.py

index af1e426..e792ce9 100644 (file)
@@ -558,16 +558,15 @@ class PackageTool(object):
         charms_list = []
         for k1, v1 in sol006_dict.items():
             for k2, v2 in v1.items():
-                if 'vnf-configuration' in k2:
-                    for vnf_config in v2:
-                        for k3, v3 in vnf_config.items():
-                            if 'charm' in v3:
-                                charms_list.append((v3['charm']))
-                if 'vdu-configuration' in k2:
-                    for vdu_config in v2:
-                        for k3, v3 in vdu_config.items():
-                            if 'charm' in v3:
-                                charms_list.append((v3['charm']))
+                if k2 == "df":
+                    for df in v2:
+                        lcm_ops = df.get("lcm-operations-configuration", {})
+                        ops_config = lcm_ops.get("operate-vnf-op-config", {})
+                        for day_12_config in ops_config.get("day1-2", []):
+                            self._logger.debug("Execution environment found")
+                            for ee in day_12_config.get("execution-environment-list", []):
+                                if "juju" in ee:
+                                    charms_list.append((ee["juju"]['charm']))
         return charms_list
 
     def _charms_search_on_nsd_sol006_dict(self, sol006_dict):