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

adds flag to config to expunge vm immediately on destroy #75

Closed
wants to merge 4 commits into from

Conversation

j00p34
Copy link

@j00p34 j00p34 commented May 14, 2015

FIXES #74

@coveralls
Copy link

Coverage Status

Coverage increased (+0.23%) to 84.8% when pulling d0cd498 on j00p34:master into 8498fc1 on schubergphilis:master.

@@ -417,6 +422,9 @@ def finalize!
# private ip is nil by default
@private_ip_address = nil if @private_ip_address == UNSET_VALUE

# expunge on destroy is nil by default
@expunge_on_destroy = nil if @expunge_on_destroy == UNSET_VALUE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't is be better to make @expunge_on_destroy = false by default?
I understand that making it nil will have the same effect because later you do ... if expunge_on_destroy != nil (at L105 of terminate_instance https://github.com/schubergphilis/vagrant-cloudstack/pull/75/files#diff-b45563ef209cc71636c6684e13c4a82eR105) , but if you never set it to nil, you don't actually need the extra check, and can always pass the value to the API call.

This will probably have impact on the spec tests too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that. But I'm not completely clear on what will happen if I pass this option to a cloudstack API that doesn't support the expunge option. Will it silently ignore adding extra parameters to the call?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CloudStack will ignore the extra parameters, but if the API call does not support it and a user still defines the parameter, then it will be passed to the API call and ignored. All this while the user expects the behaviour.

You are passing this to the server.destroy and we have to make sure this one accepts the parameter, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we could chek if this parameter does anything. But fog passes anything we add to options directly to cloudstack api

Timothy van Zadelhoff added 2 commits May 15, 2015 10:50
expunge_on_destroy default to false
expunge on destroy default to false
@miguelaferreira
Copy link
Contributor

That's it. I will merge this as soon as I can test it (the cloud guys are working on fixing something first).

One comment: the commit messages you use are not that informative of what you did. Food for thought.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.23%) to 84.8% when pulling 6e776d4 on j00p34:master into 8498fc1 on schubergphilis:master.

@j00p34
Copy link
Author

j00p34 commented May 15, 2015

I admit I'm struggling with that. Maybe I should try reading other people's commits to learn from :-)

@j00p34 j00p34 closed this May 15, 2015
@j00p34 j00p34 reopened this May 15, 2015
@j00p34
Copy link
Author

j00p34 commented May 15, 2015

sorry wrong button

@coveralls
Copy link

Coverage Status

Coverage increased (+0.23%) to 84.8% when pulling 6e776d4 on j00p34:master into 8498fc1 on schubergphilis:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.23%) to 84.8% when pulling 6e776d4 on j00p34:master into 8498fc1 on schubergphilis:master.

@miguelaferreira
Copy link
Contributor

@j00p34 one test is failing!

fix test. expunge_on_destroy false
@coveralls
Copy link

Coverage Status

Coverage increased (+0.23%) to 84.8% when pulling 73fb03c on j00p34:master into 8498fc1 on schubergphilis:master.

@j00p34
Copy link
Author

j00p34 commented May 18, 2015

test fixed

@miguelaferreira
Copy link
Contributor

I merged other PR before yours and because of that it does not merge cleanly anymore. Sorry for that.
I will rebase your PR on top of master, resolve conflicts and merge.

@j00p34
Copy link
Author

j00p34 commented May 26, 2015

Very busy at the moment, so if it's not to much trouble.. else give me a day and I'll fix it myself

miguelaferreira added a commit that referenced this pull request May 26, 2015
@miguelaferreira
Copy link
Contributor

Merged manually in commit 3320126

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

Successfully merging this pull request may close these issues.

VMs are not expunged after being destroyed
3 participants