def create_or_use_flavor(mydb, vims, flavor_dict, rollback_list, only_create_at_vim=False, return_on_error = None):
def create_or_use_flavor(mydb, vims, flavor_dict, rollback_list, only_create_at_vim=False, return_on_error = None):
'ram':flavor_dict.get('ram'),
'vcpus':flavor_dict.get('vcpus'),
}
'ram':flavor_dict.get('ram'),
'vcpus':flavor_dict.get('vcpus'),
}
if cp.get("id-ref") == iface.get("internal-connection-point-ref"):
db_interface["net_id"] = net_id2uuid[vld.get("id")]
for cp_descriptor in vnfd_descriptor["connection-point"]:
if cp.get("id-ref") == iface.get("internal-connection-point-ref"):
db_interface["net_id"] = net_id2uuid[vld.get("id")]
for cp_descriptor in vnfd_descriptor["connection-point"]:
break
if str(cp_descriptor.get("port-security-enabled")).lower() == "false":
db_interface["port_security"] = 0
break
if str(cp_descriptor.get("port-security-enabled")).lower() == "false":
db_interface["port_security"] = 0
" referenced by any internal-vld".format(
vnf=vnfd_id, vdu=vdu_id, iface=iface["name"],
" referenced by any internal-vld".format(
vnf=vnfd_id, vdu=vdu_id, iface=iface["name"],
"name": get_str(vdu, "name", 250) + "-flv",
"vcpus": int(vdu["vm-flavor"].get("vcpu-count", 1)),
"ram": int(vdu["vm-flavor"].get("memory-mb", 1)),
"name": get_str(vdu, "name", 250) + "-flv",
"vcpus": int(vdu["vm-flavor"].get("vcpu-count", 1)),
"ram": int(vdu["vm-flavor"].get("memory-mb", 1)),
extended_text = yaml.safe_dump(extended, default_flow_style=True, width=256)
db_flavor["extended"] = extended_text
# look if flavor exist
extended_text = yaml.safe_dump(extended, default_flow_style=True, width=256)
db_flavor["extended"] = extended_text
# look if flavor exist
'ram': db_flavor.get('ram'),
'vcpus': db_flavor.get('vcpus'),
'extended': db_flavor.get('extended')
'ram': db_flavor.get('ram'),
'vcpus': db_flavor.get('vcpus'),
'extended': db_flavor.get('extended')
myflavorDict["description"] = VNFCitem["description"]
myflavorDict["ram"] = vnfc.get("ram", 0)
myflavorDict["vcpus"] = vnfc.get("vcpus", 0)
myflavorDict["description"] = VNFCitem["description"]
myflavorDict["ram"] = vnfc.get("ram", 0)
myflavorDict["vcpus"] = vnfc.get("vcpus", 0)
myflavorDict["description"] = VNFCitem["description"]
myflavorDict["ram"] = vnfc.get("ram", 0)
myflavorDict["vcpus"] = vnfc.get("vcpus", 0)
myflavorDict["description"] = VNFCitem["description"]
myflavorDict["ram"] = vnfc.get("ram", 0)
myflavorDict["vcpus"] = vnfc.get("vcpus", 0)