Sha256: d2265534655b1c1c1834d8c25c95866535db16c0a8c7cba8820a0770180acd64

Contents?: true

Size: 955 Bytes

Versions: 50

Compression:

Stored size: 955 Bytes

Contents

module Actions
  module Pulp3
    module ContentView
      class DeleteRepositoryReferences < Pulp3::AbstractAsyncTask
        def plan(content_view, smart_proxy)
          if content_view.repository_references.any?
            plan_self(:content_view_id => content_view.id, :smart_proxy_id => smart_proxy.id)
          end
        end

        def invoke_external_task
          tasks = []
          content_view = ::Katello::ContentView.find(input[:content_view_id])
          content_view.repository_references.each do |repository_reference|
            repo = repository_reference.root_repository.library_instance
            #force pulp3 in case we've done migrations, but haven't switched over yet
            tasks << repo.backend_service(smart_proxy, true).delete_repository(repository_reference)
          end
          content_view.repository_references.destroy_all

          output[:pulp_tasks] = tasks
        end
      end
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
katello-4.1.2.1 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-4.0.2 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-4.1.2 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-3.18.4 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-4.1.1 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-4.1.0 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-4.0.1.2 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-3.18.3.1 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-4.1.0.rc2.2 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-4.1.0.rc2.1 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-4.0.1.1 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-3.18.3 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-4.1.0.rc2 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-4.0.1 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-4.1.0.rc1.1 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-4.1.0.rc1 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-4.0.0 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-4.0.0.rc3.1 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-4.0.0.rc3 app/lib/actions/pulp3/content_view/delete_repository_references.rb
katello-3.18.2.1 app/lib/actions/pulp3/content_view/delete_repository_references.rb