Sha256: 9e9d3011aa8464a31db78fe2d83eee6d429c1a50d1e852b51012a661b8d5fac2

Contents?: true

Size: 1.11 KB

Versions: 64

Compression:

Stored size: 1.11 KB

Contents

module Actions
  module Katello
    module ContentView
      class Destroy < Actions::EntryAction
        middleware.use ::Actions::Middleware::RemoteAction

        def plan(content_view, options = {})
          action_subject(content_view)
          if options.fetch(:check_ready_to_destroy, true)
            content_view.check_ready_to_destroy!
          end

          sequence do
            concurrence do
              content_view.content_view_versions.each do |version|
                plan_action(ContentViewVersion::Destroy, version, options)
              end
            end

            if SmartProxy.pulp_primary&.pulp3_enabled?
              plan_action(Actions::Pulp3::ContentView::DeleteRepositoryReferences, content_view, SmartProxy.pulp_primary)
            end
            plan_self
          end
        end

        def finalize
          content_view = ::Katello::ContentView.find(input[:content_view][:id])
          content_view.content_view_repositories.each(&:destroy)
          content_view.destroy!
        end

        def humanized_name
          _("Delete")
        end
      end
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
katello-4.4.2.2 app/lib/actions/katello/content_view/destroy.rb
katello-4.4.2.1 app/lib/actions/katello/content_view/destroy.rb
katello-4.4.2 app/lib/actions/katello/content_view/destroy.rb
katello-4.4.1 app/lib/actions/katello/content_view/destroy.rb
katello-4.4.0.2 app/lib/actions/katello/content_view/destroy.rb
katello-4.4.0.1 app/lib/actions/katello/content_view/destroy.rb
katello-4.3.1 app/lib/actions/katello/content_view/destroy.rb
katello-4.4.0 app/lib/actions/katello/content_view/destroy.rb
katello-4.4.0.rc2 app/lib/actions/katello/content_view/destroy.rb
katello-4.4.0.rc1 app/lib/actions/katello/content_view/destroy.rb
katello-4.2.2 app/lib/actions/katello/content_view/destroy.rb
katello-4.3.0 app/lib/actions/katello/content_view/destroy.rb
katello-4.3.0.rc4 app/lib/actions/katello/content_view/destroy.rb
katello-4.3.0.rc3 app/lib/actions/katello/content_view/destroy.rb
katello-4.3.0.rc2.1 app/lib/actions/katello/content_view/destroy.rb
katello-4.3.0.rc2 app/lib/actions/katello/content_view/destroy.rb
katello-4.3.0.rc1 app/lib/actions/katello/content_view/destroy.rb
katello-4.2.1 app/lib/actions/katello/content_view/destroy.rb
katello-4.2.0.1 app/lib/actions/katello/content_view/destroy.rb
katello-4.1.4 app/lib/actions/katello/content_view/destroy.rb