1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[aws|compute] Fix allocate_address mocking.

This commit is contained in:
Dan Peterson 2012-02-15 16:34:17 -04:00
parent 122286b3c0
commit a41d5d6526

View file

@ -30,17 +30,19 @@ module Fog
class Mock
def allocate_address(domain = 'standard')
domain = domain == 'vpc' ? 'vpc' : 'standard'
response = Excon::Response.new
if describe_addresses.body['addressesSet'].size < self.data[:limits][:addresses]
response.status = 200
public_ip = Fog::AWS::Mock.ip_address
data ={
data = {
'instanceId' => nil,
'publicIp' => public_ip
'publicIp' => public_ip,
'domain' => domain
}
self.data[:addresses][public_ip] = data
response.body = {
'domain' => standard,
'domain' => domain,
'publicIp' => public_ip,
'requestId' => Fog::AWS::Mock.request_id
}