Bug 1540250
| Summary: | internal server error when configuration_script is requested | |||
|---|---|---|---|---|
| Product: | Red Hat CloudForms Management Engine | Reporter: | Martin Kourim <mkourim> | |
| Component: | API | Assignee: | Bill Wei <bilwei> | |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Parthvi Vala <pvala> | |
| Severity: | high | Docs Contact: | ||
| Priority: | medium | |||
| Version: | 5.9.0 | CC: | cpelland, gmccullo, nansari, obarenbo, simaishi | |
| Target Milestone: | GA | Keywords: | TestOnly, ZStream | |
| Target Release: | 5.10.0 | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | api:rest:services | |||
| Fixed In Version: | 5.10.0.0 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1552271 (view as bug list) | Environment: | ||
| Last Closed: | 2019-02-11 14:03:38 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | CFME Core | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1552271 | |||
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. 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. |
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