Sha256: 767cf3c8aae9e933339bb04711a5e781c29dcd704d6b782e84389b6a6a0bd8b8
Contents?: true
Size: 1.07 KB
Versions: 13
Compression:
Stored size: 1.07 KB
Contents
module Actions module Candlepin class AbstractAsyncTask < Candlepin::Abstract include Actions::Base::Polling def run(event = nil) # do nothing when the action is being skipped unless event == Dynflow::Action::Skip super end end def humanized_state case state when :running if self.external_task.nil? _("initiating Candlepin task") else _("checking Candlepin task status") end when :suspended _("waiting for Candlepin to finish the task") else super end end def done? !::Katello::Resources::Candlepin::Job.not_finished?(external_task) end private def poll_external_task task = ::Katello::Resources::Candlepin::Job.get(external_task[:id]) check_for_errors!(task) task end def check_for_errors!(task) if task[:state] == 'FAILED' fail ::Katello::Errors::CandlepinError, task[:resultData] end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems