Fix bug 1039: Pass config to native charms in instantiating time 46/8746/8
authorDavid Garcia <david.garcia@canonical.com>
Wed, 1 Apr 2020 14:14:59 +0000 (16:14 +0200)
committergarciadav <david.garcia@canonical.com>
Tue, 7 Apr 2020 09:13:11 +0000 (11:13 +0200)
Native charms should be deployed with the config params in the VNFD

Change-Id: Id430039c7e8daa04d92408d2050743e4ba3cb399
Signed-off-by: David Garcia <david.garcia@canonical.com>
osm_lcm/ns.py

index b25629d..5d4f34d 100644 (file)
@@ -1230,7 +1230,24 @@ class NsLcm(LcmBase):
 
             # TODO check if already done
             self.logger.debug(logging_text + step)
-            await self.n2vc.install_configuration_sw(ee_id=ee_id, artifact_path=artifact_path, db_dict=db_dict)
+            config = None
+            if not is_proxy_charm:
+                initial_config_primitive_list = config_descriptor.get('initial-config-primitive')
+                if initial_config_primitive_list:
+                    for primitive in initial_config_primitive_list:
+                        if primitive["name"] == "config":
+                            config = self._map_primitive_params(
+                                primitive,
+                                {},
+                                deploy_params
+                            )
+                            break
+            await self.n2vc.install_configuration_sw(
+                ee_id=ee_id,
+                artifact_path=artifact_path,
+                db_dict=db_dict,
+                config=config
+            )
 
             # write in db flag of configuration_sw already installed
             self.update_db_2("nsrs", nsr_id, {db_update_entry + "config_sw_installed": True})