From 137b0d9e53007e4c6903493036c113d124b12b21 Mon Sep 17 00:00:00 2001 From: tierno Date: Fri, 6 Oct 2017 14:03:05 +0200 Subject: [PATCH] fix port security false at new IM Change-Id: I53808a401016c5b823b1db8a30c8fa805b224ce4 Signed-off-by: tierno --- openmanod | 2 +- osm_ro/nfvo.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/openmanod b/openmanod index 8a06a582..6d0b32e9 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.29-r539" +__version__ = "0.5.30-r540" version_date = "Oct 2017" database_version = 27 # expected database schema version diff --git a/osm_ro/nfvo.py b/osm_ro/nfvo.py index f3fb7b75..049cb50c 100644 --- a/osm_ro/nfvo.py +++ b/osm_ro/nfvo.py @@ -1021,9 +1021,10 @@ 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 - # 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" @@ -1037,6 +1038,10 @@ def new_vnfd_v3(mydb, tenant_id, vnf_descriptor): 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}]':" -- 2.25.1