Bug 1894009

Summary: Generating Red Hat cloud inventory fails if there are foreman_hooks available
Product: Red Hat Satellite Reporter: Anand Agrawal <aagrawal>
Component: RH Cloud - InventoryAssignee: Shimon Shtein <sshtein>
Status: CLOSED ERRATA QA Contact: Mirek Długosz <mzalewsk>
Severity: high Docs Contact:
Priority: medium    
Version: 6.8.0CC: ahumbe, aruzicka, egolov, jjeffers, kkohli, snemeth
Target Milestone: 6.9.0Keywords: Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_hooks-0.3.17 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1899320 1899325 (view as bug list) Environment:
Last Closed: 2021-04-21 13:18:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Anand Agrawal 2020-11-03 10:07:59 UTC
Description of problem:

Generating Red Hat clound inventory via Web UI or foreman-rake fails as below:

# foreman-rake rh_cloud_inventory:report:generate

API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache.
rake aborted!
NoMethodError: undefined method `name' for "2.0.12":String
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_hooks-0.3.16/lib/foreman_hooks/as_dependencies_hook.rb:6:in `block (2 levels) in 
load_missing_constant'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_rh_cloud-2.0.12/lib/tasks/rh_cloud_inventory.rake:15:in `block (3 levels) in <top (required)>'

Version-Release number of selected component (if applicable):
6.8

How reproducible:

Always
Steps to Reproduce:
1. Enable foreman_hooks on Red Hat Satellite
2. Now try to generate Red Hat cloud inventory
3.

Actual results:
rake aborted!
NoMethodError: undefined method `name' for "2.0.12":String
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_hooks-0.3.16/lib/foreman_hooks/as_dependencies_hook.rb:6:in `block (2 levels) in 
load_missing_constant'

Expected results:
It should be successful

Additional info:

After removing the foreman-hooks,  `foreman-rake rh_cloud_inventory:report:generate` works successfully

Comment 3 Adam Ruzicka 2020-11-18 14:21:26 UTC
Fix was merged in upstream and release in tfm-rubygem-foreman_hooks-0.3.17

Comment 8 errata-xmlrpc 2021-04-21 13:18:52 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 (Moderate: Satellite 6.9 Release), 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-2021:1313