Fix the error of contextArray is null 33/100033/2
authoryangyan <yangyanyj@chinamobile.com>
Tue, 7 Jan 2020 02:04:21 +0000 (10:04 +0800)
committerYan Yang <yangyanyj@chinamobile.com>
Tue, 7 Jan 2020 07:56:26 +0000 (07:56 +0000)
Change-Id: Ic6645457f2e4dcd49524aedf0c69787c540301ba
Issue-ID: VFC-1595
Signed-off-by: yangyan <yangyanyj@chinamobile.com>
lcm/lcm/pub/vimapi/adaptor.py

index 6cda0af..b79aaac 100644 (file)
@@ -390,7 +390,7 @@ def create_vm(vim_cache, res_cache, data, vm, do_notify, res_type):
         param["nicArray"].append({
             "portId": get_res_id(res_cache, RES_PORT, cp_id)
         })
-    param["contextArray"] = ignore_case_get(vm["properties"], "inject_files")
+    param["contextArray"] = ignore_case_get(vm["properties"], "inject_files", [])
     logger.debug("contextArray:%s", param["contextArray"])
     for vol_data in ignore_case_get(vm, "volume_storages"):
         vol_id = vol_data["volume_storage_id"]