Project

General

Profile

Actions

Bug #24957

closed

listing organization fails after adding default organization/location

Added by Marek Hulán over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Organizations and Locations
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1627679

*Description of problem:*After adding default organization/location, Listing organization and locations fails with error

NoMethodError: undefined method `organization_ids' for #<Organization:0x00007ff57ad59770>

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

*How reproducible:*Always

Steps to Reproduce:
Step 1.
[root@satellite64 ~]# hammer organization list
---|----------------------|----------------------|-------------|----------------------
ID | TITLE | NAME | DESCRIPTION | LABEL
---|----------------------|----------------------|-------------|----------------------
1 | Default Organization | Default Organization | | Default_Organization
---|----------------------|----------------------|-------------|----------------------

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

Step 3: add default
[root@satellite64 ~]# hammer defaults add --param-name organization_id --param-value 1
Added organization_id default-option with value 1.

[root@satellite64 ~]# hammer defaults list
----------------|------
PARAMETER | VALUE
----------------|------
organization_id | 1
----------------|------

Step 4: List location
[root@satellite64 ~]# hammer location list
---|-------|------|------------
ID | TITLE | NAME | DESCRIPTION
---|-------|------|------------

Step 5: Listing location raise an error
[root@satellite64 ~]# hammer organization list
Internal Server Error: the server was unable to finish the request.
This may be caused by unavailability of some required service, incorrect API call or a server-side bug. There may be more information in the server's logs.

Error in logs
NoMethodError: undefined method `organization_ids' for #<Organization:0x00007ff57ad59770>
Did you mean? organization_parameter_ids
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activemodel-5.1.6/lib/active_model/attribute_methods.rb:432:in `method_missing'

Actual results: Listing organization raises an error

Expected results: Location and Organization should be listed

Additional info:

Actions #1

Updated by The Foreman Bot over 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6075 added
Actions #2

Updated by Ivan Necas over 5 years ago

  • Subject changed from listing organization fails after adding default organization/location to listing organization fails after adding default organization/location
  • Fixed in Releases 1.20.0 added
Actions #3

Updated by Marek Hulán over 5 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF