From 39dddcc573026668192073386ae7535005cc804e Mon Sep 17 00:00:00 2001 From: tierno Date: Thu, 5 Oct 2017 18:48:06 +0200 Subject: [PATCH] Fix an issue with EPA parameters Change-Id: I0275bf3395b9a2406ed7123250fb9195ecf2c79f Signed-off-by: tierno --- openmanod | 2 +- osm_ro/nfvo.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openmanod b/openmanod index 22f4d022..8a06a582 100755 --- a/openmanod +++ b/openmanod @@ -48,7 +48,7 @@ import osm_ro __author__ = "Alfonso Tierno, Gerardo Garcia, Pablo Montes" __date__ = "$26-aug-2014 11:09:29$" -__version__ = "0.5.28-r538" +__version__ = "0.5.29-r539" version_date = "Oct 2017" database_version = 27 # expected database schema version diff --git a/osm_ro/nfvo.py b/osm_ro/nfvo.py index d5de61fc..f3fb7b75 100644 --- a/osm_ro/nfvo.py +++ b/osm_ro/nfvo.py @@ -904,22 +904,22 @@ def new_vnfd_v3(mydb, tenant_id, vnf_descriptor): 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) -- 2.25.1