set management interface by vnfd:mgmt-interface:cp 43/5643/2
authortierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 2 Nov 2017 16:01:10 +0000 (17:01 +0100)
committerbenalaya <benalaya@sensinov.com>
Fri, 3 Nov 2017 09:05:03 +0000 (11:05 +0200)
Change-Id: I1a910aad5e8edba1d001b5b4a91e741ae7eb27e5
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
openmanod
osm_ro/nfvo.py

index 149e924..14dba03 100755 (executable)
--- a/openmanod
+++ b/openmanod
@@ -48,8 +48,8 @@ import osm_ro
 
 __author__ = "Alfonso Tierno, Gerardo Garcia, Pablo Montes"
 __date__ = "$26-aug-2014 11:09:29$"
-__version__ = "0.5.37-r547"
-version_date = "Oct 2017"
+__version__ = "0.5.38-r548"
+version_date = "Nov 2017"
 database_version = 27      # expected database schema version
 
 
index bd5b5d6..c864be3 100644 (file)
@@ -998,6 +998,7 @@ def new_vnfd_v3(mydb, tenant_id, vnf_descriptor):
                 # table interfaces (internal/external interfaces)
                 cp_name2iface_uuid = {}
                 cp_name2vm_uuid = {}
+                cp_name2db_interface = {}
                 # for iface in chain(vdu.get("internal-interface").itervalues(), vdu.get("external-interface").itervalues()):
                 for iface in vdu.get("interface").itervalues():
                     iface_uuid = str(uuid4())
@@ -1035,6 +1036,7 @@ def new_vnfd_v3(mydb, tenant_id, vnf_descriptor):
                             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
+                            cp_name2db_interface[db_interface["external_name"]] = db_interface
                             for cp_descriptor in vnfd_descriptor["connection-point"]:
                                 if cp_descriptor["name"] == db_interface["external_name"]:
                                     break
@@ -1107,6 +1109,9 @@ def new_vnfd_v3(mydb, tenant_id, vnf_descriptor):
                                         HTTP_Bad_Request)
                 mgmt_access["vm_id"] = cp_name2vm_uuid[vnfd["mgmt-interface"]["cp"]]
                 mgmt_access["interface_id"] = cp_name2iface_uuid[vnfd["mgmt-interface"]["cp"]]
+                # mark this interface as of type mgmt
+                cp_name2db_interface[vnfd["mgmt-interface"]["cp"]]["type"] = "mgmt"
+
             default_user = get_str(vnfd.get("vnf-configuration", {}).get("config-access", {}).get("ssh-access", {}),
                                     "default-user", 64)