mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #2564 from maestrodev/maestro-aws-associate-testing
Fixes for AWS Mocking
This commit is contained in:
commit
afd3a02db9
3 changed files with 3 additions and 6 deletions
|
@ -192,11 +192,7 @@ module Fog
|
|||
end
|
||||
|
||||
def self.ip_address
|
||||
ip = []
|
||||
4.times do
|
||||
ip << Fog::Mock.random_numbers(rand(3) + 1).to_i.to_s # remove leading 0
|
||||
end
|
||||
ip.join('.')
|
||||
Fog::Mock.random_ip
|
||||
end
|
||||
|
||||
def self.private_ip_address
|
||||
|
|
|
@ -51,6 +51,7 @@ module Fog
|
|||
allocation_ip = describe_addresses( 'allocation-id' => "#{allocation_id}").body['addressesSet'].first
|
||||
if !allocation_ip.nil?
|
||||
public_ip = allocation_ip['publicIp']
|
||||
address = public_ip.nil? ? nil : self.data[:addresses][public_ip]
|
||||
end
|
||||
end
|
||||
if !address.nil?
|
||||
|
|
|
@ -46,7 +46,7 @@ module Fog
|
|||
|
||||
addresses_set = self.data[:addresses].values
|
||||
|
||||
aliases = {'public-ip' => 'publicIp', 'instance-id' => 'instanceId'}
|
||||
aliases = {'public-ip' => 'publicIp', 'instance-id' => 'instanceId', 'allocation-id' => 'allocationId'}
|
||||
for filter_key, filter_value in filters
|
||||
aliased_key = aliases[filter_key]
|
||||
addresses_set = addresses_set.reject{|address| ![*filter_value].include?(address[aliased_key])}
|
||||
|
|
Loading…
Add table
Reference in a new issue