Class: Actions::Pulp3::Orchestration::Repository::Create

Inherits:
Abstract
  • Object
show all
Defined in:
app/lib/actions/pulp3/orchestration/repository/create.rb

Instance Method Summary collapse

Methods inherited from Abstract

#smart_proxy

Instance Method Details

#plan(repository, smart_proxy, force = false) ⇒ Object



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

def plan(repository, smart_proxy, force = false)
  sequence do
    create_action = plan_action(Actions::Pulp3::Repository::Create, repository, smart_proxy, force)
    if repository.deb? && repository.library_instance?
      response = plan_action(Pulp3::Repository::Initialize, repository, smart_proxy)
      plan_action(Actions::Pulp3::Repository::SaveVersion, repository, tasks: response.output[:pulp_tasks])
    else
      plan_action(Actions::Pulp3::Repository::SaveVersion, repository, repository_details: create_action.output[:response])
    end

    if repository.content_view.default? || !smart_proxy.pulp_primary?
      plan_action(Actions::Pulp3::Repository::CreateRemote, repository, smart_proxy)
    end
  end
end