module HammerCLIForemanTasks::Helper
Public Instance Methods
load_task(id)
click to toggle source
# File lib/hammer_cli_foreman_tasks/helper.rb, line 12 def load_task(id) HammerCLIForeman.foreman_resource!(:foreman_tasks).call(:show, :id => id) end
task_progress(task_or_id)
click to toggle source
render the progress of the task using polling to the task API
# File lib/hammer_cli_foreman_tasks/helper.rb, line 5 def task_progress(task_or_id) task_id = task_or_id.is_a?(Hash) ? task_or_id['id'] : task_or_id task_progress = TaskProgress.new(task_id) { |id| load_task(id) } task_progress.render task_progress.success? end