Sha256: 1236baf8708e580ba4015f9155237b7f36471d2cd34f11d4d8d30c954c3b4942
Contents?: true
Size: 1.8 KB
Versions: 6
Compression:
Stored size: 1.8 KB
Contents
module Actions module Helpers module WithDelegatedAction include ::Actions::Helpers::WithContinuousOutput def plan_delegated_action(proxy, klass, options) case proxy when :not_defined if klass.is_a?(String) raise ::Foreman::Exception.new(_('No proxy defined for execution')) else delegated_action = plan_action(klass, options) end when :not_available raise ::Foreman::Exception.new(_('All proxies with the required feature are unavailable at the moment')) when ::SmartProxy delegated_action = plan_action(::Actions::ProxyAction, proxy, klass, options) end input[:delegated_action_id] = delegated_action.id delegated_action end def humanized_output delegated_output end def continuous_output_providers super.tap do |ret| ret << delegated_action if delegated_action.respond_to?(:fill_continuous_output) end end def delegated_output return @delegated_output if @delegated_output action = delegated_action @delegated_output = case action when NilClass {} when ::Actions::ProxyAction action.proxy_output(true) else action.output end end def delegated_action # TODO: make it easier in dynflow to load action data delegated_step = task.execution_plan.steps.values.find_all do |step| step.action_id == input[:delegated_action_id] end.last return unless delegated_step world.persistence.load_action(delegated_step) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems