Bug 1545240

Summary: internal server error when cloud_tenants or flavors subcollection is requested on infra provider
Product: Red Hat CloudForms Management Engine Reporter: Martin Kourim <mkourim>
Component: APIAssignee: Gregg Tanzillo <gtanzill>
Status: CLOSED CURRENTRELEASE QA Contact: Parthvi Vala <pvala>
Severity: medium Docs Contact:
Priority: high    
Version: 5.9.0CC: cpelland, gtanzill, istein, jzmeskal, obarenbo, simaishi, smallamp
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: api:rest:provider
Fixed In Version: 5.10.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1612905 (view as bug list) Environment:
Last Closed: 2019-02-11 14:08:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1612905    

Description Martin Kourim 2018-02-14 13:05:30 UTC
Description of problem:
When accessing "cloud_tenants" or "flavors" subcollection on infrastructure provider the request fails with internal server error:

{
    "error": {
        "kind": "internal_server_error",
        "message": "undefined method `cloud_tenants' for #<ManageIQ::Providers::Vmware::InfraManager:0x0000001162c120>\nDid you mean?  cloud_subnets",
        "klass": "NoMethodError"
    }
}
and
{
    "error": {
        "kind": "internal_server_error",
        "message": "undefined method `flavors' for #<ManageIQ::Providers::Vmware::InfraManager:0x00000010d40c78>",
        "klass": "NoMethodError"
    }
}

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


How reproducible:
100%


Steps to Reproduce:
1. add infrastructure provider
2. request the "cloud_tenants" or "flavors" subcollection
GET /api/providers/:id/cloud_tenants
GET /api/providers/:id/flavors

Comment 3 CFME Bot 2018-02-14 14:45:16 UTC
New commit detected on ManageIQ/manageiq-api/master:
https://github.com/ManageIQ/manageiq-api/commit/6fc044ede5c14688eb12b2436880f292f9e32486

commit 6fc044ede5c14688eb12b2436880f292f9e32486
Author:     Jillian Tullo <jtullo>
AuthorDate: Wed Feb 14 09:02:08 2018 -0500
Commit:     Jillian Tullo <jtullo>
CommitDate: Wed Feb 14 09:02:08 2018 -0500

    Infra providers do not have cloud_tenants or flavors, causing a 500 error to be returned when they are requested.
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1545240

 app/controllers/api/subcollections/cloud_tenants.rb |  2 +-
 app/controllers/api/subcollections/flavors.rb       |  2 +-
 spec/requests/cloud_tenants_spec.rb                 | 12 ++++++++++++
 spec/requests/flavors_spec.rb                       | 10 ++++++++++
 4 files changed, 24 insertions(+), 2 deletions(-)

Comment 5 Jan Zmeskal 2018-07-18 08:41:39 UTC
Is this bug going to be fixed in 5.9? I have 5.9.4.0 installed and the bug is still present in there.

Comment 10 Parthvi Vala 2018-11-06 14:13:29 UTC
FIXED. Verified on 5.10.0.22.20181030184024_26956a0.