Bug 1528339 - Got unexpected API result object Array
Summary: Got unexpected API result object Array
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Provisioning
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.10.0
Assignee: Brandon Dunne
QA Contact: Dave Johnson
URL:
Whiteboard:
Depends On:
Blocks: 1530677 1531177
TreeView+ depends on / blocked
 
Reported: 2017-12-21 15:19 UTC by Brandon Dunne
Modified: 2018-06-21 20:25 UTC (History)
5 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1530677 1531177 (view as bug list)
Environment:
Last Closed: 2018-06-21 20:25:42 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Brandon Dunne 2017-12-21 15:19:33 UTC
Description of problem:
Approving Requests of a remote region through the global region with central admin succeeds, but raises "Got unexpected API result object Array"

Version-Release number of selected component (if applicable):
Master, 5.9, 5.8

How reproducible:
100%

Steps to Reproduce:
1. Ensure that auto-approval is off (change in automate or request multiple VMs)
2. From the global region create a request to provision a VM to a provider in a remote region
3. From the global region, click on the request, click approve, enter a reason, click submit.

Actual results: Request is approved, but error is raised and presented in the UI

Expected results: Request is approved, no errors

Comment 3 Dave Johnson 2017-12-21 15:45:29 UTC
Please assess the impact of this issue and update the severity accordingly.  Please refer to https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity for a reminder on each severity's definition.

If it's something like a tracker bug where it doesn't matter, please set the severity to Low.

Comment 4 CFME Bot 2017-12-21 16:06:52 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/1eca9a8d65fd6ea16f7e1094a5bbef680feb6eb1

commit 1eca9a8d65fd6ea16f7e1094a5bbef680feb6eb1
Author:     Brandon Dunne <bdunne>
AuthorDate: Wed Dec 20 17:40:51 2017 -0500
Commit:     Brandon Dunne <bdunne>
CommitDate: Thu Dec 21 10:21:52 2017 -0500

    Send IDs through exec_api_call as a regular param not a block
    
    When sending them through an array in a block, the client calls the action
    on the collection with an array of IDs.  Unfortunately this returns an
    Array of ManageIQ::API::Client::ActionResults and Arrays aren't currently
    an expected response for this caller, so it will raise:
    "Got unexpected API result object Array"
    
    Rather than dealing with the confusion of calling .first on the array,
    allow an ID to be passed in.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1526009
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1528339

 app/models/mixins/inter_region_api_method_relay.rb | 13 ++---
 .../mixins/inter_region_api_method_relay_spec.rb   | 66 +++++++---------------
 2 files changed, 23 insertions(+), 56 deletions(-)


Note You need to log in before you can comment on or make changes to this bug.