pearkes/tugboat — pull request #31 by pearkes (2013-05-05 13:44:41+00:00)
Title: Droplet State Checks

The addition of #30 made me think of this.

Basically, during FindDroplet, we already retrieve the details of a droplet. This includes the Droplet's "status". For example, if a Droplet is shutdown it's status is `off`.

So, we know that some commands require certain state before working properly.

I added several middleware's: `CheckDropletInactive` and `CheckDropletActive`. This simply looks at the `droplet_status` injected during `FindDroplet`, and if it's not active/inactive, raises an error to the user.

This might be overkill and too hand-holdy. I can't really decide, but I thought I would write it anyway to show what it's like. I'm personally a bit on the fence about including it.