Sha256: 74fd5cdc185490a7930188f093a2cd9133309063c512db6b32f8a42d11d8345a

Contents?: true

Size: 915 Bytes

Versions: 77

Compression:

Stored size: 915 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 == ::Katello::RootRepository::DOWNLOAD_ON_DEMAND
        end
      end
    end
  end
end

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
katello-4.16.0 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.15.1 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.16.0.rc2 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.16.0.rc1 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.14.3 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.14.2 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.15.0 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.15.0.rc2 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.15.0.rc1 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.14.1 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.14.0 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.14.0.rc3 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.14.0.rc2 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.14.0.rc1.1 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.14.0.rc1 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.13.1 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.13.0 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.12.1 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.13.0.rc1 app/lib/actions/katello/repository/fetch_pxe_files.rb
katello-4.12.0 app/lib/actions/katello/repository/fetch_pxe_files.rb