Sha256: c070e12682e73465db81498181f4287bcf0a1bc5440cc04f0f889df939638cc3
Contents?: true
Size: 1.03 KB
Versions: 21
Compression:
Stored size: 1.03 KB
Contents
module Actions module Katello module Repository class FilteredIndexContent < Actions::EntryAction middleware.use Actions::Middleware::KeepCurrentUser input_format do param :id, Integer param :filter param :dependency end def run repo = ::Katello::Repository.find(input[:id]) unit_ids = search_units(repo) if repo.puppet? ::Katello::PuppetModule.import_for_repository(repo) elsif repo.docker? ::Katello::DockerManifest.import_for_repository(repo) elsif repo.file? ::Katello::FileUnit.import_for_repository(repo) else ::Katello::Rpm.import_all(unit_ids) end end private def search_units(repo) found = repo.unit_search(:type_ids => [repo.unit_type_id], :filters => input[:filter]) found.map { |result| result.try(:[], :unit_id) }.compact end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems