Class: Katello::Pulp3::Repository::Generic

Inherits:
Katello::Pulp3::Repository show all
Defined in:
app/services/katello/pulp3/repository/generic.rb

Constant Summary

Constants inherited from Katello::Pulp3::Repository

COPY_UNIT_PAGE_SIZE

Instance Attribute Summary

Attributes inherited from Katello::Pulp3::Repository

#repo, #smart_proxy

Instance Method Summary collapse

Methods inherited from Katello::Pulp3::Repository

#add_content, #add_content_for_repo, #api, api, #append_proxy_cacert, #common_remote_options, #compute_remote_options, #content_service, #copy_all, #copy_units_by_href, #copy_version, #core_api, #create, #create_distribution, #create_mirror_entities, #create_options, #create_publication, #create_remote, #create_version, #delete_distributions, #delete_distributions_by_path, #delete_remote, #delete_repository, #delete_version, #distribution_needs_update?, #distribution_reference, #fail_missing_publication, #generate_backend_object_name, #get_distribution, #get_remote, #initialize, instance_for_type, #list, #lookup_distributions, #lookup_publication, #lookup_version, #mirror_remote_options, publication_href?, #publication_options, #published?, #read, #read_distribution, #refresh_distributions, #refresh_if_needed, #refresh_mirror_entities, #relative_path, #remote_partial_update, #remove_content, #repair, #repository_import_content, #repository_reference, #retain_package_versions_count, #save_distribution_references, #secure_distribution_options, #should_purge_empty_contents?, #skip_types, #specific_create_options, #ssl_remote_options, #sync, #sync_url_params, #unit_keys, #update, #update_distribution, #update_remote, version_href?, #version_zero?, #with_mirror_adapter

Methods included from ServiceCommon

#create_remote, #create_test_remote, #ignore_404_exception, #reformat_api_exception, #test_remote_name

Methods included from Util::HttpProxy

#proxy, #proxy_host, #proxy_port, #proxy_scheme, #proxy_uri

Constructor Details

This class inherits a constructor from Katello::Pulp3::Repository

Instance Method Details

#copy_content_for_source(source_repository, _options = {}) ⇒ Object



5
6
7
# File 'app/services/katello/pulp3/repository/generic.rb', line 5

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

#distribution_options(path) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/services/katello/pulp3/repository/generic.rb', line 9

def distribution_options(path)
  options = {
    base_path: path,
    name: "#{generate_backend_object_name}"
  }

  if ::Katello::RepositoryTypeManager.find(repo.content_type).pulp3_skip_publication
    options.merge!(repository_version: repo.version_href)
  else
    options.merge!(publication: repo.publication_href)
  end

  options
end

#partial_repo_pathObject



33
34
35
# File 'app/services/katello/pulp3/repository/generic.rb', line 33

def partial_repo_path
  "/pulp/content/#{repo.relative_path}/".sub('//', '/')
end

#remote_optionsObject



24
25
26
27
28
29
30
31
# File 'app/services/katello/pulp3/repository/generic.rb', line 24

def remote_options
  generic_remote_options = JSON.parse(root.generic_remote_options)
  if generic_remote_options.any?
    common_remote_options.merge(generic_remote_options).symbolize_keys
  else
    common_remote_options
  end
end