fix port security false at new IM 40/5540/1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 6 Oct 2017 12:03:05 +0000 (14:03 +0200)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 6 Oct 2017 12:09:12 +0000 (14:09 +0200)
Change-Id: I53808a401016c5b823b1db8a30c8fa805b224ce4
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
openmanod
osm_ro/nfvo.py

index 8a06a58..6d0b32e 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.29-r539"
+__version__ = "0.5.30-r540"
 version_date = "Oct 2017"
 database_version = 27      # expected database schema version
 
index f3fb7b7..049cb50 100644 (file)
@@ -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}]':"