Bug 1696273

Summary: Katello::Content uses removed Katello::Glue::Candlepin::Product.import_product_content
Product: Red Hat Satellite Reporter: Evgeni Golov <egolov>
Component: Content ManagementAssignee: Jonathon Turel <jturel>
Status: CLOSED ERRATA QA Contact: Mike McCune <mmccune>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: mmccune, zhunting
Target Milestone: 6.5.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.10.0.43-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:40:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Evgeni Golov 2019-04-04 12:50:57 UTC
In #25981, we removed <code>import_product_content</code> from <code>Katello::Glue::Candlepin::Product</code>, however, this method is still used in <code>Katello::Content</code>:

<pre>
    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
</pre>

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

Comment 1 Evgeni Golov 2019-04-04 12:51:00 UTC
Created from redmine issue https://projects.theforeman.org/issues/26535

Comment 2 Evgeni Golov 2019-04-04 12:51:03 UTC
Upstream bug assigned to None

Comment 6 Brad Buckingham 2019-04-05 18:12:59 UTC
The PR was merged yesterday, but seems automation did not move BZ to POST.  Doing it now.

Comment 10 Mike McCune 2019-04-18 04:28:29 UTC
VERIFIED in Snap 23

# 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
Importing Katello::OstreeBranch
Importing Activation Key Subscriptions
Importing Linked Repositories

Comment 12 errata-xmlrpc 2019-05-14 12:40:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:1222