fix 1238. Fix error introduced at commit 9405d17 13/9813/1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Wed, 7 Oct 2020 16:47:44 +0000 (16:47 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Wed, 7 Oct 2020 16:47:59 +0000 (16:47 +0000)
Change-Id: I123a16cee0d867c048d9bc0e52242ce12d7f150f
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
RO/osm_ro/nfvo.py

index ca73a09..d63ebf5 100644 (file)
@@ -4172,7 +4172,7 @@ def instantiate_vnf(mydb, sce_vnf, params, params_out, rollbackList):
             if RO_pub_key:
                 cloud_config_vm = unify_cloud_config(cloud_config_vm, {"key-pairs": [RO_pub_key]})
         if vm.get("boot_data"):
-            cloud_config_vm = unify_cloud_config(vm["boot_data"], cloud_config_vm)
+            cloud_config_vm_ = cloud_config_vm = unify_cloud_config(vm["boot_data"], cloud_config_vm)
 
         if myVMDict.get('availability_zone'):
             av_index = vnf_availability_zones.index(myVMDict['availability_zone'])
@@ -4932,8 +4932,8 @@ def instance_action(mydb,nfvo_tenant,instance_id, action_dict):
                                 "item": "instance_wim_nets", "item_id": db_vm_iface["instance_wim_net_id"]}})
                     task_params_copy = deepcopy(task_params)
                     cloud_config_vm = task_params_copy[6] or {}
-                    cloud_config_vm.pop("user-data", None)
                     if vdu.get("cloud_init"):
+                        cloud_config_vm.pop("user-data", None)
                         cloud_config_vm_ = unify_cloud_config(cloud_config_vm, {"user-data": vdu["cloud_init"][index]})
                         task_params_copy[6] = cloud_config_vm_
                     for iface in task_params_copy[5]: