Class: Katello::ManagedContentMediumProvider
- Inherits:
-
MediumProviders::Provider
- Object
- MediumProviders::Provider
- Katello::ManagedContentMediumProvider
- Defined in:
- app/services/katello/managed_content_medium_provider.rb
Instance Method Summary collapse
-
#additional_media ⇒ Object
If there are any ‘AppStream’ variants, we need to make them available to Anaconda.
- #architecture_name ⇒ Object
- #kickstart_repo ⇒ Object
- #medium_uri(path = "") ⇒ Object
- #unique_id ⇒ Object
- #validate ⇒ Object
Instance Method Details
#additional_media ⇒ Object
If there are any ‘AppStream’ variants, we need to make them available to Anaconda
19 20 21 22 |
# File 'app/services/katello/managed_content_medium_provider.rb', line 19 def additional_media appstream_repos = entity..variant_repos(entity, 'AppStream') super + (appstream_repos.present? ? appstream_repos : []) end |
#architecture_name ⇒ Object
34 35 36 |
# File 'app/services/katello/managed_content_medium_provider.rb', line 34 def architecture_name kickstart_repo.try(:distribution_arch) end |
#kickstart_repo ⇒ Object
30 31 32 |
# File 'app/services/katello/managed_content_medium_provider.rb', line 30 def kickstart_repo @kickstart_repo ||= entity.try(:content_facet).try(:kickstart_repository) || entity.try(:kickstart_repository) end |
#medium_uri(path = "") ⇒ Object
11 12 13 14 15 |
# File 'app/services/katello/managed_content_medium_provider.rb', line 11 def medium_uri(path = "") url = kickstart_repo.full_path(entity.content_source, true) url += '/' + path unless path.empty? URI.parse(url) end |
#unique_id ⇒ Object
24 25 26 27 28 |
# File 'app/services/katello/managed_content_medium_provider.rb', line 24 def unique_id @unique_id ||= begin "#{kickstart_repo.name.parameterize}-#{kickstart_repo.id}" end end |
#validate ⇒ Object
3 4 5 6 7 8 9 |
# File 'app/services/katello/managed_content_medium_provider.rb', line 3 def validate errors = [] errors << N_("Kickstart repository was not set for host '%{host}'") % { :host => entity } if kickstart_repo.nil? errors << N_("Content source was not set for host '%{host}'") % { :host => entity } if entity.content_source.nil? errors end |