if vdu["guest-epa"].get("numa-node-policy"): # TODO or dedicated_int:
numa_node_policy = vdu["guest-epa"].get("numa-node-policy")
if numa_node_policy.get("node"):
- numa_node = numa_node_policy.node[0]
+ numa_node = numa_node_policy["node"]['0']
if numa_node.get("num-cores"):
numa["cores"] = numa_node["num-cores"]
epa_vcpu_set = True
if numa_node.get("paired-threads"):
if numa_node["paired-threads"].get("num-paired-threads"):
- numa["paired-threads"] = numa_node["paired-threads"]["num-paired-threads"]
+ numa["paired-threads"] = int(numa_node["paired-threads"]["num-paired-threads"])
epa_vcpu_set = True
- if len(numa_node["paired-threads"].get("paired-thread-ids")) > 0:
+ if len(numa_node["paired-threads"].get("paired-thread-ids")):
numa["paired-threads-id"] = []
- for pair in numa_node["paired-threads"]["paired-thread-ids"].itervalues:
+ for pair in numa_node["paired-threads"]["paired-thread-ids"].itervalues():
numa["paired-threads-id"].append(
(str(pair["thread-a"]), str(pair["thread-b"]))
)
if numa_node.get("num-threads"):
- numa["threads"] = numa_node["num-threads"]
+ numa["threads"] = int(numa_node["num-threads"])
epa_vcpu_set = True
if numa_node.get("memory-mb"):
numa["memory"] = max(int(numa_node["memory-mb"] / 1024), 1)
db_interface["external_name"] = get_str(cp, "name", 255)
cp_name2iface_uuid[db_interface["external_name"]] = iface_uuid
cp_name2vm_uuid[db_interface["external_name"]] = vm_uuid
- # TODO add port-security-enable
- # if cp.get("port-security-enabled") == False:
- # elif cp.get("port-security-enabled") == True:
+ if cp.get("port-security-enabled") == False:
+ db_interface["port_security"] = 0
+ elif cp.get("port-security-enabled") == True:
+ db_interface["port_security"] = 1
except KeyError:
raise NfvoException("Error. Invalid VNF descriptor at 'vnfd[{vnf}]':'vdu[{vdu}]':"
"'interface[{iface}]':'vnfd-connection-point-ref':'{cp}' is not present"
for cp in vld.get("internal-connection-point").itervalues():
if cp.get("id-ref") == iface.get("internal-connection-point-ref"):
db_interface["net_id"] = net_id2uuid[vld.get("id")]
+ if cp.get("port-security-enabled") == False:
+ db_interface["port_security"] = 0
+ elif cp.get("port-security-enabled") == True:
+ db_interface["port_security"] = 1
break
except KeyError:
raise NfvoException("Error. Invalid VNF descriptor at 'vnfd[{vnf}]':'vdu[{vdu}]':"