fog/fog — pull request #2564 by dougforpres (2014-01-10 17:44:24+00:00)
Title: Fixes for AWS Mocking

Was writing some unit tests for code that uses AWS 'associate_address' method... found issues in mock code.

lib/fog/aws.rb
Previously chose 4xRandom numbers between 0 and 999, now uses the Mock random_ip which returns numbers that will be within acceptable number range.
Old method was returning invalid numbers that then failed to pass range checks.

lib/fog/aws/requests/compute/associate_address.rb
Re-fetch address if we have to look up public-ip using allocation-id, otherwise it remains nil and the ip-address/instance aren't updated correctly.

lib/fog/aws/requests/compute/describe_addresses.rb
The allocate-address request uses allocation-id to look up ip address if allocation-id is given instead of public-ip, so added that as searchable in mock data.