seamusabshere/engineyard-metadata — pull request #6 by nickmarden (2012-02-01 21:18:08+00:00)
Title: Two bug fixes + ability to retrieve Amazon instance IDs

This pull request contains two bug fixes and one feature suggestion.

First, I was unable to get the code as it exists to work on Ruby 1.8.7 or 1.9.3 without 508de4d or 5ca121c.

- 508de4d simply corrects the assumption that a home directory exists in FakeFS. Without the home directory, you can't create the .eyrc file :-)

- 5ca121c was the result of failed eat (0.1.8) calls. They simply weren't getting intercepted by FakeWeb, so I replaced them with open-uri-based open() calls. I'm happy to have this patch replaced by a working version of eat.

Second, the reason I was doing this work at all...

- a6574ce allows the user to ask for attributes other than public_hostname. I need this because I am working on a project in which I will be automatically creating EC2 ELB instances inside an EY environment (!) and I didn't want to write a dna.json parser when a nice one like engineyard-metadata already existed. Note that I forced the attribute "amazon_id" to mean "amazon_id" in the case of EY API calls, and "id" in the case of dna.json parsing.