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
Updated by The Foreman Bot about 6 years ago
- Status changed from New to Ready For Testing
- Assignee set to Ondřej Pražák
- Pull request https://github.com/theforeman/foreman_openscap/pull/359 added
Updated by Marek Hulán about 6 years ago
- Subject changed from Listing policy fails after adding default organization/location to Listing policy fails after adding default organization/location
- Target version set to foreman_openscap 0.10.4
- Fixed in Releases foreman_openscap 0.10.4 added
Updated by Ondřej Pražák about 6 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman_openscap|cc5897b256fd46695571153b02f229a3c472e328.