Sha256: 18ac451279380c3152b92041dd0da8062ad81812a0db0fd5ad1cb56863708042

Contents?: true

Size: 1.3 KB

Versions: 83

Compression:

Stored size: 1.3 KB

Contents

module Actions
  module Katello
    module Organization
      class ManifestDelete < Actions::AbstractAsyncTask
        middleware.use Actions::Middleware::PropagateCandlepinErrors

        include Helpers::Notifications

        def plan(organization)
          action_subject(organization)

          sequence do
            plan_action(Candlepin::Owner::DestroyImports, label: organization.label)

            repositories = ::Katello::Repository.in_default_view.in_product(::Katello::Product.redhat.in_org(organization))
            repositories.each do |repo|
              plan_action(Katello::Repository::RefreshRepository, repo)
            end
            plan_self
          end
        end

        def failure_notification(plan)
          ::Katello::UINotifications::Subscriptions::ManifestDeleteError.deliver!(
            :subject => subject_organization,
            :task => get_foreman_task(plan)
          )
        end

        def success_notification(_plan)
          ::Katello::UINotifications::Subscriptions::ManifestDeleteSuccess.deliver!(
            subject_organization
          )
        end

        def humanized_name
          _("Delete Manifest")
        end

        def finalize
          subject_organization.audit_manifest_action(_('Manifest deleted'))
        end
      end
    end
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
katello-4.11.1 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.11.0 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.11.0.rc2 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.11.0.rc1 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.10.0 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.9.2 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.10.0.rc2 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.10.0.rc1 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.8.4 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.9.1 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.8.3 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.9.0 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.7.6 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.8.2 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.9.0.rc2 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.9.0.rc1 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.8.1 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.7.5 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.8.0 app/lib/actions/katello/organization/manifest_delete.rb
katello-4.8.0.rc2 app/lib/actions/katello/organization/manifest_delete.rb