Class: Actions::Pulp3::CapsuleContent::Sync

Inherits:
AbstractAsyncTask show all
Includes:
Helpers::SmartProxySyncHistoryHelper
Defined in:
app/lib/actions/pulp3/capsule_content/sync.rb

Instance Method Summary collapse

Methods included from Helpers::SmartProxySyncHistoryHelper

#done?, included, #rescue_external_task

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



14
15
16
17
18
19
# File 'app/lib/actions/pulp3/capsule_content/sync.rb', line 14

def invoke_external_task
  repo = ::Katello::Repository.find(input[:repository_id])
  sync_options = {}
  sync_options[:optimize] = false if sync_options[:skip_metadata_check]
  output[:pulp_tasks] = repo.backend_service(smart_proxy).with_mirror_adapter.sync(sync_options)
end

#plan(repository, smart_proxy, options = {}) ⇒ Object



6
7
8
9
10
11
12
# File 'app/lib/actions/pulp3/capsule_content/sync.rb', line 6

def plan(repository, smart_proxy, options = {})
  sequence do
    sync_task = plan_self(:repository_id => repository.id, :smart_proxy_id => smart_proxy.id, :options => options)
    options[:sync_task_output] = sync_task.output[:pulp_tasks]
    plan_action(GenerateMetadata, repository, smart_proxy, options)
  end
end

#rescue_strategy_for_selfObject



21
22
23
24
25
26
# File 'app/lib/actions/pulp3/capsule_content/sync.rb', line 21

def rescue_strategy_for_self
  # There are various reasons the syncing fails, not all of them are
  # fatal: when fail on syncing, we continue with the task ending up
  # in the warning state, but not locking further syncs
  Dynflow::Action::Rescue::Skip
end