Sha256: 964fc7434f981b241fac2be0c378ca22aa782e405bf78c0f701cbb94d4c499aa

Contents?: true

Size: 1.62 KB

Versions: 5

Compression:

Stored size: 1.62 KB

Contents

module Actions
  module Katello
    module CapsuleContent
      class SyncCapsule < ::Actions::EntryAction
        include Actions::Katello::PulpSelector
        def plan(smart_proxy, options = {})
          action_subject(smart_proxy)
          environment = options[:environment]
          content_view = options[:content_view]
          repository = options[:repository]
          skip_metadata_check = options.fetch(:skip_metadata_check, false)

          smart_proxy_helper = ::Katello::SmartProxyHelper.new(smart_proxy)
          sequence do
            smart_proxy_helper.repos_available_to_capsule(environment, content_view, repository).in_groups_of(Setting[:foreman_proxy_content_batch_size], false) do |repos|
              concurrence do
                repos.each do |repo|
                  plan_pulp_action([Actions::Pulp::Orchestration::Repository::SmartProxySync,
                                    Actions::Pulp3::CapsuleContent::Sync],
                                     repo, smart_proxy,
                                     skip_metadata_check: skip_metadata_check)

                  if repo.is_a?(::Katello::Repository) &&
                    repo.distribution_bootable? &&
                    repo.download_policy == ::Runcible::Models::YumImporter::DOWNLOAD_ON_DEMAND
                    plan_action(Katello::Repository::FetchPxeFiles,
                                id: repo.id,
                                capsule_id: smart_proxy.id)
                  end
                end
              end
            end
          end
        end

        def resource_locks
          :link
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
katello-3.17.0.rc1 app/lib/actions/katello/capsule_content/sync_capsule.rb
katello-3.16.0 app/lib/actions/katello/capsule_content/sync_capsule.rb
katello-3.16.0.rc5.1 app/lib/actions/katello/capsule_content/sync_capsule.rb
katello-3.16.0.rc5 app/lib/actions/katello/capsule_content/sync_capsule.rb
katello-3.16.0.rc4.1 app/lib/actions/katello/capsule_content/sync_capsule.rb