@profiler.trace
def port_create(request, network_id, **kwargs):
 LOG.debug(('port_create(): netid=%s, kwargs=%s' % (network_id, kwargs)))
 if ('policy_profile_id' in kwargs):
  kwargs['n1kv:profile'] = kwargs.pop('policy_profile_id')
 kwargs = unescape_port_kwargs(**kwargs)
 body = {'port': {'network_id': network_id}}
 if ('tenant_id' not in kwargs):
  kwargs['tenant_id'] = request.user.project_id
 body['port'].update(kwargs)
 port = neutronclient(request).create_port(body=body).get('port')
 return Port(port)

@ profiler . trace def port_create ( request , network_id , ** kwargs ) : LOG . debug ( ( 'port_create(): netid=%s, kwargs=%s' % ( network_id , kwargs ) ) ) if ( 'policy_profile_id' in kwargs ) : kwargs [ 'n1kv:profile' ] = kwargs . pop ( 'policy_profile_id' ) kwargs = unescape_port_kwargs ( ** kwargs ) body = { 'port' : { 'network_id' : network_id } } if ( 'tenant_id' not in kwargs ) : kwargs [ 'tenant_id' ] = request . user . project_id body [ 'port' ] . update ( kwargs ) port = neutronclient ( request ) . create_port ( body = body ) . get ( 'port' ) return Port ( port )
create a port on a specified network .