saltstack/salt-contrib — pull request #53 by mpilar (2013-09-19 20:29:59+00:00)
Title: Make ec2_info.py less naive

The calls to the ec2 meta-data service were causing collisions with themselves because of the naive storage, it now takes the whole URL path in order to create the keys for the dict.

In addition it was failing to properly catch some useful values properly, like the public keys, which would get stored as {'ec2_0=keyname': None}, this has been corrected by checking for the return value of _call_aws().

Keep in mind this still uses a naive and quick method for mapping the meta-data service to a dict, but it's still very useful.