Sha256: 36000128532a62a2aa69b2351a250af69c0b4f5065e669d21cad403feea41850
Contents?: true
Size: 1.64 KB
Versions: 20
Compression:
Stored size: 1.64 KB
Contents
module Actions module Katello module Organization class ManifestImport < Actions::AbstractAsyncTask middleware.use Actions::Middleware::PropagateCandlepinErrors include Helpers::Notifications def plan(organization, path, force) action_subject organization manifest_update = organization.products.redhat.any? sequence do plan_action(Candlepin::Owner::Import, :label => organization.label, :path => path, :force => force) plan_action(Candlepin::Owner::ImportProducts, :organization_id => organization.id) if manifest_update && SETTINGS[:katello][:use_pulp] organization.products.redhat.flat_map(&:repositories).each do |repo| plan_action(Katello::Repository::RefreshRepository, repo) end end plan_self end end def failure_notification(plan) ::Katello::UINotifications::Subscriptions::ManifestImportError.deliver!( :subject => subject_organization, :task => get_foreman_task(plan) ) end def success_notification(_plan) ::Katello::UINotifications::Subscriptions::ManifestImportSuccess.deliver!( subject_organization ) end def humanized_name _("Import Manifest") end def finalize subject_organization.update_attributes!( :manifest_refreshed_at => Time.now, :audit_comment => _('Manifest imported')) end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems