Sha256: ad65b773fb46609ad4f1ea3d247f131139339617db6d3d10f437058c337750c4
Contents?: true
Size: 1.59 KB
Versions: 12
Compression:
Stored size: 1.59 KB
Contents
require File.expand_path("../engine", File.dirname(__FILE__)) namespace :katello do desc "Runs a katello ping and prints out the statuses of each service" task :check_ping => :environment do ::User.current = ::User.anonymous_admin ping_results = Katello::Ping.ping if ping_results[:status] != "ok" pp ping_results fail("Not all the services have been started. Check the status report above and try again.") end end desc "Reimports information from backend systems" task :reimport => ["dynflow:client", "katello:check_ping"] do User.current = User.anonymous_admin #set a user for orchestration Dir.glob(Katello::Engine.root.to_s + '/app/models/katello/*.rb').each { |file| require file } models = [ Katello::Subscription, Katello::Pool, Katello::ContentViewPuppetEnvironment, Katello::Content ] Katello::RepositoryTypeManager.repository_types.each_value do |repo_type| indexable_types = repo_type.content_types_to_index if SmartProxy.pulp_primary.pulp3_repository_type_support?(repo_type) puts "\e[33mIgnoring types: #{indexable_types&.map { |type| type.model_class.name }}\e[0m\n" else models += indexable_types&.map(&:model_class) end end models.each do |model| print "Importing #{model.name}\n" model.import_all end print "Importing Activation Key Subscriptions\n" Katello::ActivationKey.all.each do |ack_key| ack_key.import_pools end print "Importing Linked Repositories" Katello::Repository.linked_repositories.each(&:index_content) end end
Version data entries
12 entries across 12 versions & 1 rubygems