Sha256: 9f812ee293007eff5bfa79566ccc5f5068b74e2dbaf4edd1a9dabfa4de651b57

Contents?: true

Size: 1.53 KB

Versions: 8

Compression:

Stored size: 1.53 KB

Contents

require 'pulp_file_client'

module Katello
  module Pulp3
    class Repository
      class File < ::Katello::Pulp3::Repository
        def api_exception_class
          PulpFileClient::ApiError
        end

        def remote_class
          PulpFileClient::FileRemote
        end

        def self.api_client(smart_proxy)
          PulpFileClient::ApiClient.new(smart_proxy.pulp3_configuration(PulpFileClient::Configuration))
        end

        def remotes_api
          PulpFileClient::RemotesFileApi.new(api_client)
        end

        def publication_class
          PulpFileClient::FilePublication
        end

        def publications_api
          PulpFileClient::PublicationsFileApi.new(api_client)
        end

        def distribution_class
          PulpFileClient::FileDistribution
        end

        def distributions_api
          PulpFileClient::DistributionsFileApi.new(api_client)
        end

        def copy_content_for_source(source_repository, _options = {})
          copy_units_by_href(source_repository.files.pluck(:pulp_id))
        end

        def distribution_options(path)
          {
            base_path: path,
            publication: repo.publication_href,
            name: "#{backend_object_name}"
          }
        end

        def remote_options
          #TODO: move to user specifying PULP_MANIFEST
          if root.url.blank?
            common_remote_options.merge(url: nil)
          else
            common_remote_options.merge(url: root.url + '/PULP_MANIFEST')
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
katello-3.13.4 app/services/katello/pulp3/repository/file.rb
katello-3.13.3 app/services/katello/pulp3/repository/file.rb
katello-3.13.2 app/services/katello/pulp3/repository/file.rb
katello-3.13.1 app/services/katello/pulp3/repository/file.rb
katello-3.13.0 app/services/katello/pulp3/repository/file.rb
katello-3.13.0.rc2.1 app/services/katello/pulp3/repository/file.rb
katello-3.13.0.rc2 app/services/katello/pulp3/repository/file.rb
katello-3.13.0.rc1 app/services/katello/pulp3/repository/file.rb