diff --git a/lib/foreman_inventory_upload/async/shell_process.rb b/lib/foreman_inventory_upload/async/shell_process.rb index 92b269d5..e4124137 100644 --- a/lib/foreman_inventory_upload/async/shell_process.rb +++ b/lib/foreman_inventory_upload/async/shell_process.rb @@ -7,6 +7,7 @@ class ShellProcess < ::Actions::EntryAction include ::ForemanRhCloud::Async::ExponentialBackoff def plan(instance_label, more_inputs = {}) + clear_task_output(instance_label) inputs = more_inputs.merge(instance_label: instance_label) plan_self(inputs) end @@ -53,6 +54,11 @@ def rescue_strategy_for_self Dynflow::Action::Rescue::Fail end + def clear_task_output(label) + TaskOutputLine.where(label: label).delete_all + TaskOutputStatus.where(label: label).delete_all + end + private def preprocess_command(command)