#NEWLINE# def _do_cancel( self , runner , runnertype_db , action_db , liveaction_db ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# extra = { #NEWLINE# #INDENT# 'runner' : runner , #NEWLINE# #UNINDENT# } #NEWLINE# LOG . debug ( 'Performing cancel for runner: %s' , runner . runner_id , extra = extra ) #NEWLINE# runner . cancel ( ) #NEWLINE# liveaction_db = update_liveaction_status ( status = action_constants . LIVEACTION_STATUS_CANCELED , end_timestamp = date_utils . get_datetime_utc_now ( ) , liveaction_db = liveaction_db ) #NEWLINE# executions . update_execution ( liveaction_db ) #NEWLINE# LOG . debug ( 'Performing post_run for runner: %s' , runner . runner_id ) #NEWLINE# result = { #NEWLINE# #INDENT# 'error' : 'Execution canceled by user.' , #NEWLINE# #UNINDENT# } #NEWLINE# runner . post_run ( status = tb . status , result = result ) #NEWLINE# runner . container_service = None #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# ( _ , ex , tb ) = sys . exc_info ( ) #NEWLINE# result = { #NEWLINE# #INDENT# 'error' : str ( ex ) , #NEWLINE# 'traceback' : '' . join ( traceback . format_tb ( tb , 20 ) ) , #NEWLINE# #UNINDENT# } #NEWLINE# LOG . exception ( ( 'Failed to cancel action %s.' % liveaction_db . id ) , extra = result ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# status = liveaction_db . status #NEWLINE# self . _clean_up_auth_token ( runner = runner , status = status ) #NEWLINE# #UNINDENT# return liveaction_db