Sha256: 7d36ddc8ea40021ef1957ab0b21759ab6e1d9c023b64f4df374f67e27f3a35dd

Contents?: true

Size: 1.5 KB

Versions: 7

Compression:

Stored size: 1.5 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)
          concurrence do
            smart_proxy_helper.repos_available_to_capsule(environment, content_view, repository).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

        def resource_locks
          :link
        end

        def rescue_strategy
          Dynflow::Action::Rescue::Skip
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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