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

Don't crash when probing deleted vApp for status #324

Merged

Conversation

miha-plesko
Copy link
Contributor

@miha-plesko miha-plesko commented Sep 26, 2018

With this commit we properly capture Fog exception which is raised when GET-ing vApp by ID when vApp doesn't exist anymore. Interesting enough, the fog-vcloud raises one of

Fog::VcloudDirector::Compute::Forbidden
Fog::VcloudDirector::Compute::ServiceError

exceptions instead 404, depending on why exactly the entity couldn't be found :)

With this commit we now capture the two exceptions and convert them to much more meaningful

MiqException::MiqOrchestrationStackNotExistError

to better reflect what's going on. Also, Automation is able to properly handle this kind of exception.

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1632239

Related PRs:

@miq-bot add_label bug,gaprindashvili/yes,hammer/yes
@miq-bot assign @agrare

@miha-plesko
Copy link
Contributor Author

Not what people usually say but thanks for not looking at this yesterday @agrare ;) Happened to notice we're GET-ing the vapp by ID in two places so I refactored a bit. Feel free to look at it now, I don't think I'll change my mind again :)

With this commit we properly capture Fog exception which is
raised when GET-ing vApp by ID when vApp doesn't exist anymore.
Interesting enough, the fog-vcloud raises one of

```ruby
Fog::VcloudDirector::Compute::Forbidden
Fog::VcloudDirector::Compute::ServiceError
```

exceptions instead 404, depending on why exactly the entity
couldn't be found :)

With this commit we now capture the two exceptions and convert
them to much more meaningful

```
MiqException::MiqOrchestrationStackNotExistError
```

to better reflect what's going on. Also, Automation is able to
properly handle this kind of exception.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1632239

Signed-off-by: Miha Pleško <[email protected]>
@miha-plesko miha-plesko force-pushed the dont-crash-when-probing-deleted-vapp branch from 437e05d to 723d6ff Compare September 27, 2018 07:48
@miq-bot
Copy link
Member

miq-bot commented Sep 27, 2018

Checked commit miha-plesko@723d6ff with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 🍰

@agrare
Copy link
Member

agrare commented Sep 27, 2018

@miha-plesko haha I do what I can

@agrare agrare merged commit 723d6ff into ManageIQ:master Sep 27, 2018
agrare added a commit that referenced this pull request Sep 27, 2018
…ted-vapp

Don't crash when probing deleted vApp for status
@agrare agrare added this to the Sprint 96 Ending Oct 8, 2018 milestone Sep 27, 2018
@JPrause
Copy link
Member

JPrause commented Sep 28, 2018

@miq-bot add_label blocker

simaishi pushed a commit that referenced this pull request Oct 1, 2018
…ted-vapp

Don't crash when probing deleted vApp for status

(cherry picked from commit ab9549d)

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

simaishi commented Oct 1, 2018

Hammer backport details:

$ git log -1
commit 19cd3af753f1849d9d7fb1cceeb194f30ecac465
Author: Adam Grare <[email protected]>
Date:   Thu Sep 27 09:33:37 2018 -0400

    Merge pull request #324 from miha-plesko/dont-crash-when-probing-deleted-vapp
    
    Don't crash when probing deleted vApp for status
    
    (cherry picked from commit ab9549dc9083be08b705486acfe8f5e8f77e29b6)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1632239

@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit ff0e5f4438c79c49ddea98d15373e0df10bf7eb2
Author: Adam Grare <[email protected]>
Date:   Thu Sep 27 09:33:37 2018 -0400

    Merge pull request #324 from miha-plesko/dont-crash-when-probing-deleted-vapp
    
    Don't crash when probing deleted vApp for status
    
    (cherry picked from commit ab9549dc9083be08b705486acfe8f5e8f77e29b6)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1636494

@simaishi
Copy link
Contributor

Reverted the G backport.

commit dbba045575b8d0f386431fe894d5fec721ff9a8a
Author: Satoe Imaishi <[email protected]>
Date:   Thu Oct 11 16:38:44 2018 -0400

    Revert "Merge pull request #324 from miha-plesko/dont-crash-when-probing-deleted-vapp"
    
    This reverts commit ff0e5f4438c79c49ddea98d15373e0df10bf7eb2.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1636494

@miha-plesko
Copy link
Contributor Author

@simaishi why would you revert it?

@simaishi
Copy link
Contributor

@miha-plesko This was backported only because it was tied to https://bugzilla.redhat.com/show_bug.cgi?id=1636494. Since that's no longer needed in Gaprindashvili branch, I needed to revert all related PRs. We're not backporting any PRs unless it's associated to a BZ that's approved for the next release...

@miha-plesko miha-plesko deleted the dont-crash-when-probing-deleted-vapp branch January 7, 2019 08:25
agrare pushed a commit to agrare/manageiq-providers-vmware that referenced this pull request Apr 15, 2019
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