leaf port-security-enabled {
description "Enables the port security for the port";
type boolean;
+ default true;
}
}
"Use the default management interface on this VDU.";
leaf vdu-id {
type leafref {
- path "../../vdu/id";
+ path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:vdu/vnfd:id";
}
}
}
"Use the ip address associated with this connection point.";
leaf cp {
type leafref {
- path "../../connection-point/name";
+ path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:connection-point/vnfd:name";
}
}
}
"name" : kwargs['name'],
"network_id" : kwargs['network_id'],
"fixed_ips" : [ {"subnet_id": kwargs['subnet_id']}],
- "binding:vnic_type" : kwargs['port_type']}}
- if 'port_security_enabled' in kwargs:
- params["port"]["port_security_enabled"] = kwargs['port_security_enabled']
+ "binding:vnic_type" : kwargs['port_type'],
+ "port_security_enabled" : kwargs['port_security_enabled']}}
ntconn = self._get_neutron_connection()
try:
raise NotImplementedError("Port Type: %s not supported" %(c_point.type_yang))
# By default port gets created with post_security enaled as True
- if 'port_security_enabled' in c_point:
- kwargs['port_security_enabled'] = c_point.port_security_enabled
+ if c_point.port_security_enabled is not None and c_point.port_security_enabled == False:
+ kwargs['port_security_enabled'] = False
+ else:
+ kwargs['port_security_enabled'] = True
with self._use_driver(account) as drv:
if c_point.has_field('security_group'):
cpr = VnfrYang.YangData_Vnfr_VnfrCatalog_Vnfr_ConnectionPoint()
cpr.name = conn_p.name
cpr.type_yang = conn_p.type_yang
- if conn_p.has_field('port_security_enabled'):
- cpr.port_security_enabled = conn_p.port_security_enabled
-
+ cpr.port_security_enabled = conn_p.port_security_enabled
vlr_ref = find_vlr_for_cp(conn_p)
if vlr_ref is None:
msg = "Failed to find VLR for cp = %s" % conn_p.name
cp_list = []
for intf, cp, vlr in self._ext_intf:
- cp_info = { "name": cp.name,
- "virtual_link_id": vlr.network_id,
- "type_yang": intf.virtual_interface.type_yang }
-
- if cp.has_field('port_security_enabled'):
- cp_info["port_security_enabled"] = cp.port_security_enabled
+ cp_info = {"name": cp.name,
+ "virtual_link_id": vlr.network_id,
+ "type_yang": intf.virtual_interface.type_yang,
+ "port_security_enabled": cp.port_security_enabled}
if (intf.virtual_interface.has_field('vpci') and
intf.virtual_interface.vpci is not None):
"type_yang": intf.virtual_interface.type_yang,
"vpci": intf.virtual_interface.vpci})
else:
- if cp.has_field('port_security_enabled'):
- cp_list.append({"name": cp,
- "virtual_link_id": vlr.network_id,
- "type_yang": intf.virtual_interface.type_yang,
- "port_security_enabled": cp.port_security_enabled})
- else:
- cp_list.append({"name": cp,
- "virtual_link_id": vlr.network_id,
- "type_yang": intf.virtual_interface.type_yang})
-
+ cp_list.append({"name": cp,
+ "virtual_link_id": vlr.network_id,
+ "type_yang": intf.virtual_interface.type_yang,
+ "port_security_enabled": cp.port_security_enabled})
vm_create_msg_dict["connection_points"] = cp_list
vm_create_msg_dict.update(vdu_copy_dict)