Project

General

Profile

Bug #26535

Katello::Content uses removed Katello::Glue::Candlepin::Product.import_product_content

Added by Evgeni Golov about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
High
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

In #25981, we removed import_product_content from Katello::Glue::Candlepin::Product, however, this method is still used in Katello::Content:

    def self.import_all
      Organization.all.each do |org|
        org.products.each do |product|
          begin
            product_json = Katello::Resources::Candlepin::Product.get(org.label,
                                                                  product.cp_id,
                                                                  %w(productContent)).first
            product_content_attrs = product_json['productContent']
            Katello::Glue::Candlepin::Product.import_product_content(product, product_content_attrs)
          rescue RestClient::NotFound
            Rails.logger.warn _("Product with ID %s not found in Candlepin. Skipping content import for it.") % product.cp_id
          end
        end
      end
    end

I think this code is only called in the katello:reimport rake task, but that one will fail now.


Related issues

Related to Katello - Bug #25981: Manifest upload task takes too much timeClosed

Associated revisions

Revision 1a4660e9 (diff)
Added by Jonathon Turel about 3 years ago

Fixes #26535 - Fix Content reimport

History

#1 Updated by Evgeni Golov about 3 years ago

  • Related to Bug #25981: Manifest upload task takes too much time added

#2 Updated by Evgeni Golov about 3 years ago

This does indeed break katello:reimport

[root@pipeline-katello-nightly-centos7 ~]# foreman-rake katello:reimport
Importing Katello::Erratum
Importing Katello::PackageGroup
Importing Katello::PuppetModule
Importing Katello::Rpm
Importing Katello::Srpm
Importing Katello::ModuleStream
Importing Katello::YumMetadataFile
Importing Katello::Deb
Importing Katello::FileUnit
Importing Katello::Subscription
Importing Katello::Pool
Importing Katello::DockerManifest
Importing Katello::DockerManifestList
Importing Katello::DockerTag
Importing Katello::ContentViewPuppetEnvironment
Importing Katello::Content
rake aborted!
NoMethodError: undefined method `import_product_content' for Katello::Glue::Candlepin::Product:Module
Did you mean?  import_from_cp
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.pre.master/app/models/katello/content.rb:46:in `block (2 levels) in import_all'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/delegation.rb:41:in `each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/delegation.rb:41:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.pre.master/app/models/katello/content.rb:40:in `block in import_all'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/delegation.rb:41:in `each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/delegation.rb:41:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.pre.master/app/models/katello/content.rb:39:in `import_all'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.pre.master/lib/katello/tasks/reimport.rake:41:in `block (3 levels) in <top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.pre.master/lib/katello/tasks/reimport.rake:39:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.pre.master/lib/katello/tasks/reimport.rake:39:in `block (2 levels) in <top (required)>'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => katello:reimport
(See full trace by running task with --trace)

#3 Updated by Evgeni Golov about 3 years ago

  • Bugzilla link set to 1696273

#4 Updated by The Foreman Bot about 3 years ago

  • Assignee set to Jonathon Turel
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/8065 added

#5 Updated by Jonathon Turel about 3 years ago

  • Target version set to Katello 3.12.0

#6 Updated by Jonathon Turel about 3 years ago

  • Status changed from Ready For Testing to Closed

#7 Updated by Chris Roberts about 3 years ago

  • Triaged changed from No to Yes
  • Fixed in Releases Katello 3.12.0 added

Also available in: Atom PDF