Bug 1631340

Summary: Listing policy fails after adding default organization/location
Product: Red Hat Satellite Reporter: Ranjan Kumar <rankumar>
Component: SCAP PluginAssignee: Ondřej Pražák <oprazak>
Status: CLOSED WONTFIX QA Contact: Sanket Jagtap <sjagtap>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.4CC: jhutar, mhulan, oprazak, rankumar
Target Milestone: UnspecifiedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: All   
Whiteboard:
Fixed In Version: foreman_openscap 0.10.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-01 13:31:08 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 Ranjan Kumar 2018-09-20 11:34:12 UTC
Description of problem: After adding default organization/location, Listing policy fails with error

wrong number of arguments (given 1, expected 0)


Version-Release number of selected component (if applicable): Satellite 6.4
satellite-6.4.0-14.el7sat.noarch

How reproducible: Always

Steps to Reproduce:

[root@satellite64 ~]# hammer location list
---|------------------|------------------|------------
ID | TITLE            | NAME             | DESCRIPTION
---|------------------|------------------|------------
2  | Default Location | Default Location |            
---|------------------|------------------|------------


[root@satellite64 ~]# hammer defaults list
------------|------
PARAMETER   | VALUE
------------|------
location_id | 2    
------------|------

[root@satellite64 ~]# hammer policy list
wrong number of arguments (given 1, expected 0)

Error in production.log
--------------------
ArgumentError: wrong number of arguments (given 1, expected 0)
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_openscap-0.10.3/app/controllers/api/v2/compliance/policies_controller.rb:13:in `resource_name'
/usr/share/foreman/app/controllers/api/base_controller.rb:376:in `extract_resource_from_param'
/usr/share/foreman/app/controllers/api/base_controller.rb:357:in `block in parent_resource_details'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_controller/metal/strong_parameters.rb:332:in `block in each_pair'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_controller/metal/strong_parameters.rb:331:in `each_pair'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_controller/metal/strong_parameters.rb:331:in `each_pair'
/usr/share/foreman/app/controllers/api/base_controller.rb:355:in `parent_resource_details'
/usr/share/foreman/app/controllers/api/base_controller.rb:69:in `parent_scope'
/usr/share/foreman/app/controllers/api/base_controller.rb:64:in `resource_scope'
/usr/share/foreman/app/controllers/api/base_controller.rb:104:in `resource_scope_for_index'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_openscap-0.10.3/app/controllers/api/v2/compliance/policies_controller.rb:29:in `index'

Actual results: fails with error


Expected results: should list policy


Additional info:

Comment 2 Brad Buckingham 2018-09-21 17:39:42 UTC
Hi Ranjan,

Could this be a duplicate of bug 1627679?

Comment 3 Ranjan Kumar 2018-09-22 01:19:33 UTC
No, I applied the patch mentioned in bug 1627679 but it still failed. I think the fix is required in foreman_openscap.

Comment 4 Ondřej Pražák 2018-09-25 06:27:47 UTC
*** Bug 1632252 has been marked as a duplicate of this bug. ***

Comment 5 Ondřej Pražák 2018-09-25 10:43:56 UTC
Created redmine issue http://projects.theforeman.org/issues/25028 from this bug

Comment 6 Satellite Program 2018-09-25 12:04:37 UTC
Upstream bug assigned to oprazak

Comment 7 Satellite Program 2018-09-25 12:04:41 UTC
Upstream bug assigned to oprazak

Comment 10 Satellite Program 2018-10-11 16:04:50 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25028 has been resolved.

Comment 11 Bryan Kearney 2020-05-01 13:31:08 UTC
Satellite 6.4 is now End of Life. These bus will not be fixed on the 6.4 stream. Users of Satellite should upgrade to the latest version of Satellite to get access to the most current set of bugfixes and feature improvements.