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:
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)
"mtu": self.vl_profile.get("mtu", const.DEFAULT_MTU),
"vlan_transparent": self.vl_profile.get("vlanTransparent", False),
"subnet_list": [{
- "subnet_name": self.vl_profile.get("initiationParameters").get("name", ""),
+ "subnet_name": self.vl_profile.get("networkName"), # self.vl_profile.get("initiationParameters").get("name", ""),
"cidr": self.vl_profile.get("cidr", "192.168.0.0/24"),
"ip_version": self.vl_profile.get("ip_version", const.IPV4),
"enable_dhcp": self.vl_profile.get("dhcpEnabled", False),
"resourceProviderType": "",
"resourceProviderId": "",
"subnet_list": [{
- "subnet_name": self.vl_profile.get("initiationParameters").get("name", ""),
+ "subnet_name": self.vl_profile.get("networkName", ""), # self.vl_profile.get("initiationParameters").get("name", ""),
"cidr": self.vl_profile.get("cidr", "192.168.0.0/24"),
"ip_version": self.vl_profile.get("ip_version", const.IPV4),
"enable_dhcp": self.vl_profile.get("dhcpEnabled", False),
def get_network_info_of_vl(self, vl_id):
for vnf_info in self.nsd_model['vls']:
if vnf_info['vl_id'] == vl_id:
- return vnf_info['properties']['vl_profile']['networkName'], vnf_info['properties']['vl_profile']['initiationParameters']['name']
+ return vnf_info['properties']['vl_profile']['networkName'], vnf_info['properties']['vl_profile']['networkName'] # ['initiationParameters']['name']
return '', ''
def send_nf_init_request_to_vnfm(self):