From: tierno Date: Thu, 2 Nov 2017 16:01:10 +0000 (+0100) Subject: set management interface by vnfd:mgmt-interface:cp X-Git-Tag: v3.0.0rc15~1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F43%2F5643%2F2;p=osm%2FRO.git set management interface by vnfd:mgmt-interface:cp Change-Id: I1a910aad5e8edba1d001b5b4a91e741ae7eb27e5 Signed-off-by: tierno --- diff --git a/openmanod b/openmanod index 149e9245..14dba03f 100755 --- 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 diff --git a/osm_ro/nfvo.py b/osm_ro/nfvo.py index bd5b5d6d..c864be3b 100644 --- a/osm_ro/nfvo.py +++ b/osm_ro/nfvo.py @@ -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)