#NEWLINE# @ log . log_method_call #NEWLINE# def create_l2_policy( self , context , l2_policy ) : #NEWLINE# #INDENT# l2p = l2_policy [ 'l2_policy' ] #NEWLINE# tenant_id = self . _get_tenant_id_for_create ( context , l2p ) #NEWLINE# with context . session . begin ( subtransactions = True ) : #NEWLINE# #INDENT# l2p_db = L2Policy ( id = uuidutils . generate_uuid ( ) , tenant_id = tenant_id , name = l2p [ 'name' ] , description = l2p [ 'description' ] , l3_policy_id = l2p [ 'l3_policy_id' ] , inject_default_route = l2p . get ( 'inject_default_route' , True ) , shared = l2p . get ( 'shared' , False ) ) #NEWLINE# context . session . add ( l2p_db ) #NEWLINE# #UNINDENT# return self . _make_l2_policy_dict ( l2p_db )