#NEWLINE# def gbp_action_config( self , cmd_val , name_uuid , **kwargs ) : #NEWLINE# #INDENT# '\n        -- cmd_val== 0:delete; 1:create; 2:update\n        -- name_uuid == UUID or name_string\n        Create/Update/Delete Policy Action\n        Returns assigned UUID on Create\n        kwargs addresses the need for passing required/optional params\n        ' #NEWLINE# if ( ( cmd_val == '' ) or ( name_uuid == '' ) ) : #NEWLINE# #INDENT# _log . info ( 'Function Usage: gbp_action_config 0 "abc"\n\n                       --cmd_val == 0:delete; 1:create; 2:update\n\n                       -- name_uuid == UUID or name_string\n' ) #NEWLINE# return 0 #NEWLINE# #UNINDENT# if ( cmd_val == 0 ) : #NEWLINE# #INDENT# cmd = ( 'gbp policy-action-delete ' + str ( name_uuid ) ) #NEWLINE# #UNINDENT# if ( cmd_val == 1 ) : #NEWLINE# #INDENT# cmd = ( 'gbp policy-action-create ' + str ( name_uuid ) ) #NEWLINE# #UNINDENT# if ( cmd_val == 2 ) : #NEWLINE# #INDENT# cmd = ( 'gbp policy-action-update ' + str ( name_uuid ) ) #NEWLINE# #UNINDENT# for ( arg , value ) in kwargs . items ( ) : #NEWLINE# #INDENT# cmd = ( ( cmd + ' --' ) + ( '%s %s' % ( arg , value ) ) ) #NEWLINE# #UNINDENT# _log . info ( cmd ) #NEWLINE# cmd_out = commands . getoutput ( cmd ) #NEWLINE# _log . info ( cmd_out ) #NEWLINE# if ( self . cmd_error_check ( cmd_out ) == 0 ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# if ( cmd_val == 1 ) : #NEWLINE# #INDENT# action_uuid = self . get_uuid ( cmd_out ) #NEWLINE# return action_uuid