"name" : kwargs['name'],
"network_id" : kwargs['network_id'],
"fixed_ips" : [ {"subnet_id": kwargs['subnet_id']}],
- "binding:vnic_type" : kwargs['port_type'],
- "port_security_enabled" : kwargs['port_security_enabled']}}
+ "binding:vnic_type" : kwargs['port_type']}}
+ if 'port_security_enabled' in kwargs:
+ params["port"]["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 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
+ if 'port_security_enabled' in c_point:
+ kwargs['port_security_enabled'] = c_point.port_security_enabled
with self._use_driver(account) as drv:
if c_point.has_field('security_group'):
vnfr_dict.update(vnfd_copy_dict)
vnfr = RwVnfrYang.YangData_Vnfr_VnfrCatalog_Vnfr.from_dict(vnfr_dict)
-
vnfr.vnfd = VnfrYang.YangData_Vnfr_VnfrCatalog_Vnfr_Vnfd.from_dict(self.vnfd.as_dict(),
ignore_missing_keys=True)
vnfr.member_vnf_index_ref = self.member_vnf_index
cpr = VnfrYang.YangData_Vnfr_VnfrCatalog_Vnfr_ConnectionPoint()
cpr.name = conn_p.name
cpr.type_yang = conn_p.type_yang
- cpr.port_security_enabled = conn_p.port_security_enabled
+ if conn_p.has_field('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,
- "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 }
+
+ if cp.has_field('port_security_enabled'):
+ cp_info["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:
- 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})
+ 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})
+
vm_create_msg_dict["connection_points"] = cp_list
vm_create_msg_dict.update(vdu_copy_dict)