-
Notifications
You must be signed in to change notification settings - Fork 36
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
Conversation
@roliveri Would you mind taking a look at this as soon as you can? It's for a blocker bug. |
@miq-bot add_label blocker |
@sseago Can you address the codeclimate issues? |
@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? |
Oh, wait, nevermind. I was thinking about the rubocop issues. Looking at codeclimate now... |
ab3e4fa
to
15bddf7
Compare
@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? |
@sseago This is fine. I'll merge when travis completes. |
@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. |
@sseago OK, ping me when it's ready. |
@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.
15bddf7
to
c99b013
Compare
@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. |
Checked commit sseago@c99b013 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 lib/OpenStackExtract/MiqOpenStackVm/MiqOpenStackInstance.rb
|
Thanks for merging! |
@roliveri Can we ask for a release including this fix? |
@sseago Done, version 0.2.18 |
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.