Sha256: b19f3e7a19458a7cb297c28880d4a061d65fceb336e485b8af8381eff59b10b4

Contents?: true

Size: 1.28 KB

Versions: 35

Compression:

Stored size: 1.28 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)

            if 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::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

35 entries across 35 versions & 1 rubygems

Version Path
katello-3.15.3.1 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.15.3 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.15.2 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.15.1.1 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.15.1 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.15.0.1 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.15.0 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.15.0.rc2 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.15.0.rc1.3 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.15.0.rc1.2 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.15.0.rc1.1 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.15.0.rc1 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.14.1 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.13.4 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.14.0 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.13.3 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.14.0.rc2 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.13.2 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.14.0.rc1 app/lib/actions/katello/organization/manifest_delete.rb
katello-3.13.1 app/lib/actions/katello/organization/manifest_delete.rb