juju / plugins

Basic collection of the first few plugins for Juju
28 stars 29 forks source link

Adds functionality to cleanup juju daemons and lxc cruft #41

Closed codersquid closed 9 years ago

codersquid commented 9 years ago

Please do not merge this. I have questions and it is not fully tested.

I'm making a pull request based on a conversation in irc about cleanup. When my local environment is in a bad state I've been running http://paste.ubuntu.com/9677575/ (cobbled from a discussion in irc and this answer). In irc we were discussing clean and it prompted a PR nudge.

Questions/Comments about this PR

marcoceppi commented 9 years ago

That should work, on my machine it pull the proper list of templates. Trashing the templates won't cause any adverse effects to an existing deployment, when another machine is needed the template will be regenerated.

I think this logic is fine, it won't burn any actual deployed LXC machines outside of juju templates.

Doesn't appear so

Probably. Ideally I'd like to dwarf and replace this command with the juju-local plugin that is under development as it's written in Python and is structured for better sanity checking. Parsing YAML within bash isn't always fun.

Definitely, you're welcome to do so :)

It should just power through, it might be a good idea to let things fail for users to be aware but it shouldn't halt the script, just a message.

codersquid commented 9 years ago

hi @marcoceppi I started using JUJU_HOME as you suggested, and also added an || true to the service stop so that it would be more forgiving if that failed.

I'm leaving it as is with respect to checking for a local environment, I don't know the best way to do that yet and will leave it for a future commit.

but at any rate, you were going to have this functionality in a python script in the future? that will be nice.

marcoceppi commented 9 years ago

LGTM, thanks!