6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'app/lib/actions/katello/repository/create.rb', line 6
def plan(repository, clone = false, plan_create = false)
repository.save!
action_subject(repository)
org = repository.organization
path = repository.relative_path unless repository.puppet?
create_action = plan_create ? Actions::Pulp::Repository::CreateInPlan : Actions::Pulp::Repository::Create
sequence do
certs = repository.importer_ssl_options
create_action = plan_action(create_action,
content_type: repository.content_type,
pulp_id: repository.pulp_id,
name: repository.name,
docker_upstream_name: repository.docker_upstream_name,
feed: repository.url,
ssl_ca_cert: certs[:ssl_ca_cert],
ssl_client_cert: certs[:ssl_client_cert],
ssl_client_key: certs[:ssl_client_key],
unprotected: repository.unprotected,
checksum_type: repository.checksum_type,
path: path,
download_policy: repository.download_policy,
with_importer: true,
mirror_on_sync: repository.mirror_on_sync?)
return if create_action.error
unless clone
if repository.product.redhat?
plan_action(ContentView::UpdateEnvironment, org.default_content_view,
org.library, repository.content_id)
else
content_create = plan_action(Katello::Product::ContentCreate, repository)
plan_action(ContentView::UpdateEnvironment, org.default_content_view,
org.library, content_create.input[:content_id])
end
end
concurrence do
plan_action(::Actions::Pulp::Repos::Update, repository.product) if repository.product.sync_plan
plan_self(:repository_id => repository.id, :clone => clone)
end
end
end
|