NS instantiate error
[vfc/nfvo/lcm.git] / lcm / ns / biz / ns_instant.py
index d648ed2..1f72b32 100644 (file)
@@ -68,7 +68,7 @@ class InstantNSService(object):
                     vim_id = self.req_data['additionalParamForNs']['location']
                 params_json = json.JSONEncoder().encode(self.req_data["additionalParamForNs"])
             else:
-                params_json = {}
+                params_json = json.JSONEncoder().encode({})
 
             location_constraints = []
             if 'locationConstraints' in self.req_data:
@@ -84,7 +84,13 @@ class InstantNSService(object):
             plan_dict = json.JSONDecoder().decode(dst_plan)
             for vnf in ignore_case_get(plan_dict, "vnfs"):
                 vnfd_id = vnf['properties']['id']
-                vnfm_type = vnf['properties'].get("nf_type", "undefined")
+                vnfm_type_temp = vnf['properties'].get("vnfm_info", "undefined")
+                logger.debug("vnfd_id: %s, vnfm_type : %s", vnfd_id, vnfm_type_temp)
+                if vnfm_type_temp != "undefined":
+                    if isinstance(vnfm_type_temp, list):
+                        vnfm_type = vnfm_type_temp[0]
+                    if isinstance(vnfm_type_temp, str):
+                        vnfm_type = vnfm_type_temp
                 vimid = self.get_vnf_vim_id(vim_id, location_constraints, vnfd_id)
                 vnfm_info = extsys.select_vnfm(vnfm_type=vnfm_type, vim_id=vimid)