X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=models%2Fopenmano%2Fpython%2Frift%2Fopenmano%2Frift2openmano.py;fp=models%2Fopenmano%2Fpython%2Frift%2Fopenmano%2Frift2openmano.py;h=b1d1c8b06e70b6dd3a4384b4549e5e31482413eb;hb=fed61ffa7e384fcbd6cc10e3c13fadb5a72c5434;hp=276573c815267045c404ebb4f5fd29dc57123ac3;hpb=ed8392f38a80f4832a0f2afd5f3312ceec8ed06f;p=osm%2FSO.git diff --git a/models/openmano/python/rift/openmano/rift2openmano.py b/models/openmano/python/rift/openmano/rift2openmano.py index 276573c8..b1d1c8b0 100755 --- a/models/openmano/python/rift/openmano/rift2openmano.py +++ b/models/openmano/python/rift/openmano/rift2openmano.py @@ -488,6 +488,8 @@ def rift2openmano_vnfd(rift_vnfd, rift_nsd): raise ValueError("VDU Virtual Interface type {} not supported".format(rift_type)) # Add all external connections + cp_to_port_security_map = {} + for cp in rift_vnfd.cps: # Find the VDU and and external interface for this connection point vdu, ext_if = find_vdu_and_ext_if_by_cp_ref(cp.name) @@ -499,6 +501,8 @@ def rift2openmano_vnfd(rift_vnfd, rift_nsd): "description": "%s iface on VDU %s" % (ext_if.name, vdu.name), } + if cp.has_field('port_security_enabled'): + cp_to_port_security_map[cp.name] = cp.port_security_enabled vnf["external-connections"].append(connection) # Add all internal networks @@ -677,6 +681,9 @@ def rift2openmano_vnfd(rift_vnfd, rift_nsd): if bps/x[1] >= 1: intf["bandwidth"] = "{} {}bps".format(math.ceil(bps/x[1]), x[0]) + for bridge_iface in vnfc["bridge-ifaces"]: + if bridge_iface['name'] in cp_to_port_security_map: + bridge_iface['port-security'] = cp_to_port_security_map[bridge_iface['name']] # Sort bridge-ifaces-list TODO sort others newlist = sorted(vnfc["bridge-ifaces"], key=lambda k: k['name']) vnfc["bridge-ifaces"] = newlist