Class: Actions::Pulp3::Orchestration::Repository::Sync

Inherits:
Abstract
  • Object
show all
Includes:
Helpers::OutputPropagator
Defined in:
app/lib/actions/pulp3/orchestration/repository/sync.rb

Instance Method Summary collapse

Methods included from Helpers::OutputPropagator

included, #run

Methods inherited from Abstract

#smart_proxy

Instance Method Details

#plan(repository, smart_proxy, options) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/lib/actions/pulp3/orchestration/repository/sync.rb', line 7

def plan(repository, smart_proxy, options)
  sequence do
    plan_action(Actions::Pulp3::Repository::RefreshRemote, repository, smart_proxy)
    action_output = plan_action(Actions::Pulp3::Repository::Sync, repository, smart_proxy, options).output

    force_fetch_version = true if options[:optimize] == false
    version_output = plan_action(Pulp3::Repository::SaveVersion, repository, tasks: action_output[:pulp_tasks], :force_fetch_version => force_fetch_version).output

    #force contents_changed to true if we're doing a 'force' sync
    if options[:optimize] == false
      contents_changed = true
    else
      contents_changed = version_output[:contents_changed]
    end
    plan_action(Pulp3::Orchestration::Repository::, repository, smart_proxy, :contents_changed => contents_changed, :skip_publication_creation => version_output[:publication_provided])
    plan_self(:subaction_output => version_output)
  end
end