Sha256: 8d7b1aa278cfb5e086b980410dbdacada79a51adf261797e057a2296e15298fd

Contents?: true

Size: 1.03 KB

Versions: 8

Compression:

Stored size: 1.03 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

            plan_action(Actions::Pulp3::ContentView::DeleteRepositoryReferences, content_view, SmartProxy.pulp_master)
            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

8 entries across 8 versions & 1 rubygems

Version Path
katello-3.15.3.1 app/lib/actions/katello/content_view/destroy.rb
katello-3.15.3 app/lib/actions/katello/content_view/destroy.rb
katello-3.15.2 app/lib/actions/katello/content_view/destroy.rb
katello-3.15.1.1 app/lib/actions/katello/content_view/destroy.rb
katello-3.15.1 app/lib/actions/katello/content_view/destroy.rb
katello-3.15.0.1 app/lib/actions/katello/content_view/destroy.rb
katello-3.15.0 app/lib/actions/katello/content_view/destroy.rb
katello-3.15.0.rc2 app/lib/actions/katello/content_view/destroy.rb