fix unit string to int error, etc
Change-Id: I3f884a0b63d9f5000db1ecc7e6bd6f7e9c821f31
Issue-ID: VFC-1158
Signed-off-by: maopengzhang <zhang.maopeng1@zte.com.cn>
"flavorName": flavor["vimFlavourId"],
"vimid": vimid})
"flavorName": flavor["vimFlavourId"],
"vimid": vimid})
- for resource_type in ['vdus', 'vls']:
+ for resource_type in ['vdus', 'vls', 'cps', 'volume_storages']:
for resource in ignore_case_get(self.vnfd_info, resource_type):
if "location_info" in resource["properties"]:
resource["properties"]["location_info"]["vimid"] = vimid
for resource in ignore_case_get(self.vnfd_info, resource_type):
if "location_info" in resource["properties"]:
resource["properties"]["location_info"]["vimid"] = vimid
def create_volume(vim_cache, res_cache, vol, do_notify, res_type):
location_info = vol["properties"]["location_info"]
param = {
def create_volume(vim_cache, res_cache, vol, do_notify, res_type):
location_info = vol["properties"]["location_info"]
param = {
- "name": vol["properties"]["volume_name"],
- "volumeSize": int(ignore_case_get(vol["properties"], "size", "0").replace('GB', '').strip())
+ "name": vol["properties"]["volume_name"] if vol["properties"].get("volume_name", None) else vol["volume_storage_id"],
+ "volumeSize": int(ignore_case_get(vol["properties"], "size_of_storage", "0").replace('GB', '').replace('"', '').strip())
}
set_opt_val(param, "imageName", ignore_case_get(vol, "image_file"))
}
set_opt_val(param, "imageName", ignore_case_get(vol, "image_file"))
- set_opt_val(param, "volumeType", ignore_case_get(vol["properties"], "custom_volume_type"))
+ set_opt_val(param, "volumeType", ignore_case_get(vol["properties"], "type_of_storage"))
set_opt_val(param, "availabilityZone", ignore_case_get(location_info, "availability_zone"))
vim_id, tenant_name = location_info["vimid"], location_info["tenant"]
tenant_id = get_tenant_id(vim_cache, vim_id, tenant_name)
set_opt_val(param, "availabilityZone", ignore_case_get(location_info, "availability_zone"))
vim_id, tenant_name = location_info["vimid"], location_info["tenant"]
tenant_id = get_tenant_id(vim_cache, vim_id, tenant_name)
param = {
"name": vl_profile["networkName"],
"shared": False,
param = {
"name": vl_profile["networkName"],
"shared": False,
- "networkType": vl_profile["networkType"],
+ "networkType": ignore_case_get(vl_profile, "networkType"),
"physicalNetwork": ignore_case_get(vl_profile, "physicalNetwork")
}
set_opt_val(param, "vlanTransparent", ignore_case_get(vl_profile, "vlanTransparent"))
"physicalNetwork": ignore_case_get(vl_profile, "physicalNetwork")
}
set_opt_val(param, "vlanTransparent", ignore_case_get(vl_profile, "vlanTransparent"))
l3_address_data = one_protocol_data["address_data"]["l3_address_data"] # l3 is not 13
fixed_ip_address = ignore_case_get(l3_address_data, "fixed_ip_address")
ip_address.extend(fixed_ip_address)
l3_address_data = one_protocol_data["address_data"]["l3_address_data"] # l3 is not 13
fixed_ip_address = ignore_case_get(l3_address_data, "fixed_ip_address")
ip_address.extend(fixed_ip_address)
- for one_virtual_network_interface in port["properties"]["virtual_network_interface_requirements"]:
+ for one_virtual_network_interface in port["properties"].get("virtual_network_interface_requirements", []):
interfaceTypeString = one_virtual_network_interface["network_interface_requirements"]["interfaceType"]
interfaceType = json.loads(interfaceTypeString)["configuration-value"]
vnic_type = ignore_case_get(port["properties"], "vnic_type")
interfaceTypeString = one_virtual_network_interface["network_interface_requirements"]["interfaceType"]
interfaceType = json.loads(interfaceTypeString)["configuration-value"]
vnic_type = ignore_case_get(port["properties"], "vnic_type")