Module: Katello::KatelloUrlsHelper

Extended by:
ApipieDSL::Module
Included in:
Concerns::HostManagedExtensions
Defined in:
app/helpers/katello/katello_urls_helper.rb

Instance Method Summary collapse

Instance Method Details

#foreman_settings_url(schema = 'http') ⇒ Object



16
17
18
# File 'app/helpers/katello/katello_urls_helper.rb', line 16

def foreman_settings_url(schema = 'http')
  ::Setting[:foreman_url].sub(%r|^.*?:|, "#{schema}:")
end

#subscription_manager_configuration_url(host = nil, rpm = true, hostname: nil) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/helpers/katello/katello_urls_helper.rb', line 26

def subscription_manager_configuration_url(host = nil, rpm = true, hostname: nil)
  prefix = if hostname
             "http://#{hostname}"
           elsif host&.content_source
             "http://#{host.content_source.hostname}"
           else
             foreman_settings_url
           end

  config = rpm ? SETTINGS[:katello][:consumer_cert_rpm] : SETTINGS[:katello][:consumer_cert_sh]

  "#{prefix}/pub/#{config}"
end