app/lib/actions/proxy_action.rb in foreman-tasks-0.9.4 vs app/lib/actions/proxy_action.rb in foreman-tasks-0.9.5

- old
+ new

@@ -29,10 +29,12 @@ suspend when ::Dynflow::Action::Skip # do nothing when ::Dynflow::Action::Cancellable::Cancel cancel_proxy_task + when ::Dynflow::Action::Cancellable::Abort + abort_proxy_task when CallbackData on_data(event.data) when ::Dynflow::Action::Timeouts::Timeout check_task_status else @@ -74,9 +76,14 @@ else proxy.cancel_task(output[:proxy_task_id]) output[:cancel_sent] = true suspend end + end + + def abort_proxy_task + proxy.cancel_task(output[:proxy_task_id]) + error! ForemanTasks::Task::TaskCancelledException.new(_('Task aborted: the task might be still running on the proxy')) end def on_resume # TODO: add logic to load the data from the external action suspend