#NEWLINE# @ log . log_method_call #NEWLINE# def create_network_service_policy( self , context , network_service_policy ) : #NEWLINE# #INDENT# session = context . session #NEWLINE# with session . begin ( subtransactions = True ) : #NEWLINE# #INDENT# result = super ( GroupPolicyPlugin , self ) . create_network_service_policy ( context , network_service_policy ) #NEWLINE# self . extension_manager . process_create_network_service_policy ( session , network_service_policy , result ) #NEWLINE# self . _validate_shared_create ( self , context , result , 'network_service_policy' ) #NEWLINE# policy_context = p_context . NetworkServicePolicyContext ( self , context , network_service_policy ) #NEWLINE# pdm = self . policy_driver_manager #NEWLINE# pdm . create_network_service_policy_precommit ( policy_context ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# pdm . create_network_service_policy_postcommit ( policy_context ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# with excutils . save_and_reraise_exception ( ) : #NEWLINE# #INDENT# LOG . exception ( _LE ( 'create_network_service_policy_postcommit failed, deleting network_service_policy %s' ) , result [ 'id' ] ) #NEWLINE# self . delete_network_service_policy ( context , result [ 'id' ] ) #NEWLINE# #UNINDENT# #UNINDENT# return result