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:
parent
122286b3c0
commit
a41d5d6526
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue