Project

General

Profile

Actions

Bug #25028

closed

Listing policy fails after adding default organization/location

Added by Ondřej Pražák over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

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

Actions #1

Updated by The Foreman Bot over 5 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
Actions #2

Updated by Marek Hulán over 5 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
Actions #3

Updated by Ondřej Pražák over 5 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF