Description of problem: When the "configuration_script" attribute is requested the request fails with internal server error: { "error": { "kind": "internal_server_error", "message": "Association named 'configuration_script' was not found on Service; perhaps you misspelled it?", "klass": "ActiveRecord::AssociationNotFoundError" } } However the attribute is listed under the "relationships", so it should be possible to requested in the same way as all the other attributes. See OPTIONS /api/services Version-Release number of selected component (if applicable): 5.9.0.18 How reproducible: 100% Steps to Reproduce: 1. create service, e.g. POST /api/services { "name": "myservice01" } 2. request the "configuration_script" attribute GET /api/services?expand=resources&attributes=configuration_script
The virtual_has_one association 'configuration_script' is defined on the base service/service_template, this is required for reporting and possibly the API. But the required methods are only available on the Ansible Service sub-classes. I recommend that we create a empty method at the base service class which returns nil.
https://github.com/ManageIQ/manageiq/pull/16923
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/a6558c4723d83c2f00df8b26d4b0b7fd96751eaf commit a6558c4723d83c2f00df8b26d4b0b7fd96751eaf Author: Bill Wei <bilwei> AuthorDate: Wed Jan 31 16:25:33 2018 -0500 Commit: Bill Wei <bilwei> CommitDate: Wed Jan 31 16:33:02 2018 -0500 Implement #configuration_script because of virtual_has_one relationship Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1540250 app/models/service.rb | 3 +++ spec/models/service_spec.rb | 4 ++++ 2 files changed, 7 insertions(+)
FIXED. Verified on 5.10.0.30.