Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send IDs through exec_api_call as a regular param not a block #16708

Merged
merged 1 commit into from
Dec 21, 2017

Conversation

bdunne
Copy link
Member

@bdunne bdunne commented Dec 20, 2017

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

@bdunne
Copy link
Member Author

bdunne commented Dec 20, 2017

While this doesn't fix the BZ linked, it's the next problem that the customer will hit once the authentication error is fixed.

@Fryguy
Copy link
Member

Fryguy commented Dec 20, 2017

Do we support multiple ids at this level or is it only ever 1 at a time?

@bdunne
Copy link
Member Author

bdunne commented Dec 20, 2017

It's always one here. This code path is for forwarding instance methods to a remote region. There is another method for forwarding class methods.

@bdunne
Copy link
Member Author

bdunne commented Dec 20, 2017

@Fryguy since you're here... I labeled it with replication because we don't have a label for central admin. Should we have one? (it's really not replication-related)

@carbonin
Copy link
Member

If we're going to backport this I think we should probably have a BZ for the actual issue this is solving.

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
@miq-bot
Copy link
Member

miq-bot commented Dec 21, 2017

Checked commit bdunne@1eca9a8 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🍰

@carbonin carbonin added this to the Sprint 76 Ending Jan 1, 2018 milestone Dec 21, 2017
@carbonin carbonin self-assigned this Dec 21, 2017
@carbonin carbonin merged commit 2d95d40 into ManageIQ:master Dec 21, 2017
@bdunne bdunne deleted the fix_api_array_response branch December 21, 2017 16:00
simaishi pushed a commit that referenced this pull request Jan 3, 2018
Send IDs through exec_api_call as a regular param not a block
(cherry picked from commit 2d95d40)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1530677
@simaishi
Copy link
Contributor

simaishi commented Jan 3, 2018

Gaprindashvili backport details:

$ git log -1
commit ee73f02820d5b355457723e6c5adebc06496a2ed
Author: Nick Carboni <ncarboni@redhat.com>
Date:   Thu Dec 21 10:59:35 2017 -0500

    Merge pull request #16708 from bdunne/fix_api_array_response
    
    Send IDs through exec_api_call as a regular param not a block
    (cherry picked from commit 2d95d409c3f66d8acf9126469f210974ede4a057)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1530677

simaishi pushed a commit that referenced this pull request Jan 4, 2018
Send IDs through exec_api_call as a regular param not a block
(cherry picked from commit 2d95d40)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1531177
@simaishi
Copy link
Contributor

simaishi commented Jan 4, 2018

Fine backport details:

$ git log -1
commit e8d70e3f853db222652f8636022cf211e68c855f
Author: Nick Carboni <ncarboni@redhat.com>
Date:   Thu Dec 21 10:59:35 2017 -0500

    Merge pull request #16708 from bdunne/fix_api_array_response
    
    Send IDs through exec_api_call as a regular param not a block
    (cherry picked from commit 2d95d409c3f66d8acf9126469f210974ede4a057)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1531177

d-m-u pushed a commit to d-m-u/manageiq that referenced this pull request Jun 6, 2018
Send IDs through exec_api_call as a regular param not a block
(cherry picked from commit 2d95d40)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1531177
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants