Fix an issue with EPA parameters 30/5530/1 v3.0.0
authortierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 5 Oct 2017 16:48:06 +0000 (18:48 +0200)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 5 Oct 2017 16:49:59 +0000 (18:49 +0200)
Change-Id: I0275bf3395b9a2406ed7123250fb9195ecf2c79f
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
openmanod
osm_ro/nfvo.py

index 22f4d02..8a06a58 100755 (executable)
--- 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
 
index d5de61f..f3fb7b7 100644 (file)
@@ -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)