Class: Actions::Pulp3::Repository::CopyContent

Inherits:
AbstractAsyncTask show all
Defined in:
app/lib/actions/pulp3/repository/copy_content.rb

Instance Method Summary collapse

Methods inherited from AbstractAsyncTask

#cancel, #cancel!, #combined_tasks, #done?, #external_task, #humanized_state, #new_or_existing_objects, #pulp_tasks, #rescue_external_task, #run, #task_groups

Methods inherited from Abstract

#smart_proxy

Instance Method Details

#invoke_external_taskObject



11
12
13
14
15
16
17
18
19
20
# File 'app/lib/actions/pulp3/repository/copy_content.rb', line 11

def invoke_external_task
  source = ::Katello::Repository.find(input[:source_repository_id])
  target = ::Katello::Repository.find(input[:target_repository_id] || input[:target_repository])
  service = target.backend_service(smart_proxy)
  output[:pulp_tasks] = if input[:copy_all]
                          service.copy_all(source, input)
                        else
                          service.copy_content_for_source(source, input)
                        end
end

#plan(source_repository, smart_proxy, target_repository, options) ⇒ Object



5
6
7
8
9
# File 'app/lib/actions/pulp3/repository/copy_content.rb', line 5

def plan(source_repository, smart_proxy, target_repository, options)
  plan_self(options.merge(:source_repository_id => source_repository.id,
                          :target_repository_id => target_repository.id,
                          :smart_proxy_id => smart_proxy.id))
end