#NEWLINE# def create_port( self , context , port ) : #NEWLINE# #INDENT# p = port [ 'port' ] #NEWLINE# with context . session . begin ( subtransactions = True ) : #NEWLINE# #INDENT# p [ ext_sg . SECURITYGROUPS ] = self . _get_security_groups_on_port ( context , port ) #NEWLINE# neutron_db = super ( PortSecurityTestPlugin , self ) . create_port ( context , has_ip ) #NEWLINE# p . update ( neutron_db ) #NEWLINE# ( port_security , has_ip ) = self . _determine_port_security_and_has_ip ( context , p ) #NEWLINE# p [ psec . PORTSECURITY ] = port_security #NEWLINE# self . _process_port_port_security_create ( context , p , neutron_db ) #NEWLINE# if ( validators . is_attr_set ( p . get ( ext_sg . SECURITYGROUPS ) ) and ( not ( port_security and has_ip ) ) ) : #NEWLINE# #INDENT# raise psec . PortSecurityAndIPRequiredForSecurityGroups ( ) #NEWLINE# #UNINDENT# if ( has_ip and port_security ) : #NEWLINE# #INDENT# self . _ensure_default_security_group_on_port ( context , port ) #NEWLINE# #UNINDENT# if ( p . get ( ext_sg . SECURITYGROUPS ) and p [ psec . PORTSECURITY ] ) : #NEWLINE# #INDENT# self . _process_port_create_security_group ( context , p , p [ ext_sg . SECURITYGROUPS ] ) #NEWLINE# #UNINDENT# #UNINDENT# return port [ 'port' ]