Sha256: e1e1af1d6f6dc80651208d61904fa432b7182b659eef1150cc79abaae43b32ea

Contents?: true

Size: 921 Bytes

Versions: 105

Compression:

Stored size: 921 Bytes

Contents

module Actions
  module Katello
    module Repository
      class FetchPxeFiles < Actions::EntryAction
        input_format do
          param :id, Integer
          param :capsule_id, Integer
        end

        def run
          repository = ::Katello::Repository.find(input[:id])
          return unless needs_download?(repository)

          capsule = if input[:capsule_id].present?
                      SmartProxy.unscoped.find(input[:capsule_id])
                    else
                      SmartProxy.default_capsule!
                    end

          downloader = ::Katello::PxeFilesDownloader.new(repository, capsule)
          downloader.download_files
        end

        private

        def needs_download?(repository)
          repository.distribution_bootable? &&
             repository.download_policy == ::Runcible::Models::YumImporter::DOWNLOAD_ON_DEMAND
        end
      end
    end
  end
end

Version data entries

105 entries across 105 versions & 1 rubygems

Version Path
katello-4.2.2 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.2.1 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.2.0.1 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.1.4 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.0.3 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.2.0.1.rc3 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-3.18.5 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.2.0.1.rc2 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.2.0.rc2 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.1.3 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.2.0.rc1 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.0.2.1 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.1.2.1 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.0.2 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.1.2 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-3.18.4 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.1.1 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.1.0 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.0.1.2 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-3.18.3.1 app/lib/actions/katello/repository/fetch_pxe_files.rb