Bug #25028
closedListing policy fails after adding default organization/location
Description
Description of problem: After adding default organization/location, Listing policy fails with error
wrong number of arguments (given 1, expected 0)
Steps to Reproduce:
[root@foreman ~]# hammer location list
---|------------------|------------------|------------
ID | TITLE | NAME | DESCRIPTION
---|------------------|------------------|------------
2 | Default Location | Default Location |
---|------------------|------------------|------------
[root@foreman ~]# hammer defaults list
------------|------
PARAMETER | VALUE
------------|------
location_id | 2
------------|------
[root@foreman ~]# 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