Sha256: 4888b50a84ec04f4c90ed8fd7e8529075128e12d6cfd92f79257526f4900c17a

Contents?: true

Size: 1.74 KB

Versions: 19

Compression:

Stored size: 1.74 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 => ["environment", "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::Erratum,
              Katello::PackageGroup,
              Katello::PuppetModule,
              Katello::Rpm,
              Katello::Srpm,
              Katello::ModuleStream,
              Katello::YumMetadataFile,
              Katello::Deb,
              Katello::FileUnit,
              Katello::Subscription,
              Katello::Pool,
              Katello::DockerManifest,
              Katello::DockerManifestList,
              Katello::DockerTag,
              Katello::ContentViewPuppetEnvironment,
              Katello::Content]

    models << Katello::OstreeBranch if Katello::RepositoryTypeManager.find(Katello::Repository::OSTREE_TYPE).present?

    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

19 entries across 19 versions & 1 rubygems

Version Path
katello-3.14.0.rc2 lib/katello/tasks/reimport.rake
katello-3.13.2 lib/katello/tasks/reimport.rake
katello-3.14.0.rc1 lib/katello/tasks/reimport.rake
katello-3.13.1 lib/katello/tasks/reimport.rake
katello-3.13.0 lib/katello/tasks/reimport.rake
katello-3.13.0.rc2.1 lib/katello/tasks/reimport.rake
katello-3.13.0.rc2 lib/katello/tasks/reimport.rake
katello-3.12.3 lib/katello/tasks/reimport.rake
katello-3.12.2 lib/katello/tasks/reimport.rake
katello-3.13.0.rc1 lib/katello/tasks/reimport.rake
katello-3.12.1 lib/katello/tasks/reimport.rake
katello-3.11.2 lib/katello/tasks/reimport.rake
katello-3.12.0 lib/katello/tasks/reimport.rake
katello-3.12.0.rc2 lib/katello/tasks/reimport.rake
katello-3.12.0.rc1 lib/katello/tasks/reimport.rake
katello-3.11.1 lib/katello/tasks/reimport.rake
katello-3.11.0 lib/katello/tasks/reimport.rake
katello-3.11.0.rc2 lib/katello/tasks/reimport.rake
katello-3.11.0.rc1 lib/katello/tasks/reimport.rake