Class: Actions::Katello::Product::RepositoriesCertsReset

Inherits:
AbstractAsyncTask
  • Object
show all
Defined in:
app/lib/actions/katello/product/repositories_certs_reset.rb

Instance Method Summary collapse

Methods inherited from AbstractAsyncTask

#humanized_output, #rescue_strategy

Instance Method Details

#plan(product) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/lib/actions/katello/product/repositories_certs_reset.rb', line 5

def plan(product)
  ssl_ca_cert_id = product.ssl_ca_cert_id
  ssl_client_cert_id = product.ssl_client_cert_id
  ssl_client_key_id = product.ssl_client_key_id
  # Plan Repository::Update only for repositories which have different certs key
  product.repositories.each do |repo|
    if (repo.root.ssl_ca_cert_id != ssl_ca_cert_id ||
        repo.root.ssl_client_cert_id != ssl_client_cert_id ||
        repo.root.ssl_client_key_id != ssl_client_key_id)
      plan_action(::Actions::Katello::Repository::Update,
                  repo.root,
                  :ssl_ca_cert_id => ssl_ca_cert_id,
                  :ssl_client_cert_id => ssl_client_cert_id,
                  :ssl_client_key_id => ssl_client_key_id)
    end
  end
end