StackStorm/st2contrib — pull request #50 by Kami (2014-11-09 10:08:27+00:00)
Title: Docker sensor trigger refactor

This pull request refactors docker sensor to expose two triggers:

- `docker.container_tracker.started` - Dispatched when a new container has been detected / started
- `docker.container_tracker.stopped` - Dispatched when an existing container has been stopped

Previously, the sensor only exposed one trigger (`docker.container_trigger`) and the `payload` didn't contain the "event" name (started / stopped) which means the event wasn't that useful since the user would still need to manually query docker to figure out what actually happened with the container.

Besides that, I've also fixed a bug with never detecting stopped containers. We passed `all=True` to the "list containers" method which means we also got the stopped containers back so the diff between "previous" and "running" containers was always empty.