Sha256: 6e5156e128bd71a10b89935e454c37d4f04863661b5c9bacc617ca54e46c4160
Contents?: true
Size: 1.07 KB
Versions: 9
Compression:
Stored size: 1.07 KB
Contents
module Actions module Katello module ContentView class ErrataMail < Actions::EntryAction def plan(content_view, environment) plan_self(:content_view => content_view.id, :environment => environment.id) end def run ::User.current = ::User.anonymous_admin content_view = ::Katello::ContentView.find(input[:content_view]) environment = ::Katello::KTEnvironment.find(input[:environment]) users = ::User.select { |user| user.receives?(:katello_promote_errata) && user.can?(:view_content_views, content_view) } MailNotification[:katello_promote_errata].deliver(:users => users, :content_view => content_view, :environment => environment) unless users.blank? end def finalize ::User.current = nil end def rescue_strategy_for_self # If sending mail fails do not cause any calling tasks to fail # but mark the task in a WARNING state with the error message. Dynflow::Action::Rescue::Skip end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems