mapbox/swarm — pull request #4 by miccolis (2012-07-10 17:52:27+00:00)
Title: "More self" / internals refactor

This work fixes the issue where you couldn't use `--filter.Swarm _self` for a region your ec2 was not in. This "fix" ended up being a bit of a refactor of the internals;

1. `_self` can now also be used with `--region` and happens before any command execution.
2. lookups agaisnt the instance metadata api are now in their own file in `/lib` and there is a new method for lookup up the region and az of the instance.
3. calls again the ec2 api are in a different file in `/lib` and have been reworked.

The upshot of 2 & 3 is that it's probably possible to use swarms libs as APIs themselves, which could be nice for things like colonize.

**THIS NEEDS MORE TESTING**