Skip to content

bug 1641011: delete snapshot after smartstate analysis #83

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

Merged
merged 1 commit into from
Nov 29, 2018

Conversation

sseago
Copy link
Contributor

@sseago sseago commented Nov 27, 2018

fixes https://bugzilla.redhat.com/show_bug.cgi?id=1641011

For instances launched from volumes, the volume snapshot was
not being deleted after smartstate analysis.

With this PR, it gets deleted if present.

@mansam
Copy link
Contributor

mansam commented Nov 27, 2018

@roliveri Would you mind taking a look at this as soon as you can? It's for a blocker bug.

@JPrause
Copy link
Member

JPrause commented Nov 28, 2018

@miq-bot add_label blocker

@roliveri
Copy link
Member

@sseago Can you address the codeclimate issues?

@sseago
Copy link
Contributor Author

sseago commented Nov 29, 2018

@roliveri I talked to @mansam about this yesterday. I hadn't done so yet since I was just following the existing style for logging errors here. Should I add the parentheses to the logging calls, even though this doesn't seem to be done anywhere else in the manageiq-smartstate repo? Also, the rescue on error code is exactly what's being done elsewhere too. I don't want this commit to potentially introduce a new bug if the new fog call ends up raising an unexpected exception, causing the operation to blow up. Rescuing StandardError would leave functionality unchanged but would probably satisfy codeclimate -- is that the right answer for cases like this?

@sseago
Copy link
Contributor Author

sseago commented Nov 29, 2018

Oh, wait, nevermind. I was thinking about the rubocop issues. Looking at codeclimate now...

@sseago
Copy link
Contributor Author

sseago commented Nov 29, 2018

@roliveri OK, so that mostly fixes it. I still see "Method delete_evm_snapshot has 26 lines of code (exceeds 25 allowed). Consider refactoring."

Basically I'm adding a single "if " to an existing method, and that puts it one line over the limit. While I can make codeclimate happy by moving the if condition into the new method, that actually obscures the logic of the conditional method call, making it harder to see what's going on from looking at the code. Is this OK as-is, or should I move the conditional into the method?

@roliveri
Copy link
Member

@sseago This is fine. I'll merge when travis completes.

@sseago
Copy link
Contributor Author

sseago commented Nov 29, 2018

@roliveri Actually, hold off on merging. I need to confirm that this fix works properly. I thought I tested it before pushing, but it looks like I jumped the gun on the push.

@roliveri
Copy link
Member

@sseago OK, ping me when it's ready.

@sseago
Copy link
Contributor Author

sseago commented Nov 29, 2018

@roliveri another update coming shortly

fixes https://bugzilla.redhat.com/show_bug.cgi?id=1641011

For instances launched from volumes, the volume snapshot was
not being deleted after smartstate analysis.

With this PR, it gets deleted if present.
@sseago
Copy link
Contributor Author

sseago commented Nov 29, 2018

@roliveri OK, should be good to go now. The refactored method had an error in the logging code, and I forgot to check this before pushing the refactor to the PR. I just confirmed that the delete snapshot is working as expected (and logging as expected) now.

@miq-bot
Copy link
Member

miq-bot commented Nov 29, 2018

Checked commit sseago@c99b013 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 7 offenses detected

lib/OpenStackExtract/MiqOpenStackVm/MiqOpenStackInstance.rb

@roliveri roliveri merged commit e7bf1ef into ManageIQ:master Nov 29, 2018
@roliveri roliveri added this to the Sprint 100 Ending Dec 3, 2018 milestone Nov 29, 2018
@aufi
Copy link
Member

aufi commented Nov 29, 2018

Thanks for merging!

@aufi
Copy link
Member

aufi commented Dec 17, 2018

@roliveri Can we ask for a release including this fix?

@roliveri
Copy link
Member

@sseago Done, version 0.2.18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants