Sha256: 283e026fac33cc86618f6c6ba341998b2f5bb28ef7457dff38d49675a0837f42
Contents?: true
Size: 1.1 KB
Versions: 20
Compression:
Stored size: 1.1 KB
Contents
module Actions module RemoteExecution module EventHelpers module ClassEventHelpers def event_states [] end def event_names event_states.map do |state| event_name_base + '_' + event_name_suffix(state).to_s end end def feature_job_event_names(label) event_states.map do |state| ::Foreman::Observable.event_name_for("#{event_name_base}_#{label}_#{event_name_suffix(state)}") end end end def self.included(base) base.extend ClassEventHelpers end def emit_event(execution_plan, hook) return unless root_action? payload = event_payload(execution_plan) base = self.class.event_name_base suffix = self.class.event_name_suffix(hook) if input["job_features"]&.any? input['job_features'].each do |feature| name = "#{base}_#{feature}_#{suffix}" trigger_hook name, payload: payload end end trigger_hook("#{base}_#{suffix}", payload: payload) end end end end
Version data entries
20 entries across 20 versions & 1 rubygems