Sha256: 29fea64056ab98b9ffc8cd368654d4e701f73511332bf8a4762f653b014ef778
Contents?: true
Size: 1.18 KB
Versions: 51
Compression:
Stored size: 1.18 KB
Contents
# This action takes a content unit and a repository # Creates a content unit based on content type and then creates a new repository version with the added content. module Actions module Pulp3 module Repository class ImportUpload < Pulp3::AbstractAsyncTask def plan(save_artifact_output, repository, smart_proxy, options = {}) plan_self(:save_artifact_output => save_artifact_output, :repository_id => repository.id, :smart_proxy_id => smart_proxy.id, :options => options) end def invoke_external_task if input[:save_artifact_output][:pulp_tasks]&.any? content_unit_href = input[:save_artifact_output][:pulp_tasks].last[:created_resources].first else content_unit_href = input[:save_artifact_output][:content_unit_href] end repo = ::Katello::Repository.find(input[:repository_id]) repo_backend_service = repo.backend_service(smart_proxy) output[:content_unit_href] = content_unit_href output[:pulp_tasks] = [repo_backend_service.add_content(content_unit_href)] end end end end end
Version data entries
51 entries across 51 versions & 1 rubygems