mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
fix classic link mocks
This commit is contained in:
parent
160249a6c7
commit
7b0c0a3729
4 changed files with 4 additions and 4 deletions
|
@ -40,7 +40,7 @@ module Fog
|
|||
class Mock
|
||||
def describe_classic_link_instances(options={})
|
||||
response = Excon::Response.new
|
||||
instances = self.data[:instances].select {|instance| instance['classicLinkVpcId']}
|
||||
instances = self.data[:instances].values.select {|instance| instance['classicLinkVpcId']}
|
||||
if options[:filters]
|
||||
instances = apply_tag_filters(instances, options[:filters], 'instanceId')
|
||||
instances = instances.select {|instance| instance['classicLinkVpcId'] == options[:filters]['vpc-id']} if options[:filters]['vpc-id']
|
||||
|
|
|
@ -44,7 +44,7 @@ module Fog
|
|||
}
|
||||
unless dry_run
|
||||
instance['classicLinkSecurityGroups'] = nil
|
||||
instance['classicLinkVpc'] = nil
|
||||
instance['classicLinkVpcId'] = nil
|
||||
end
|
||||
response
|
||||
elsif !instance
|
||||
|
|
|
@ -44,7 +44,7 @@ module Fog
|
|||
response.body = {
|
||||
'instancesSet' => instance_set.reduce([]) do |ia, instance|
|
||||
instance['classicLinkSecurityGroups'] = nil
|
||||
instance['classicLinkVpc'] = nil
|
||||
instance['classicLinkVpcId'] = nil
|
||||
ia << {'currentState' => { 'code' => 0, 'name' => 'stopping' },
|
||||
'previousState' => instance['instanceState'],
|
||||
'instanceId' => instance['instanceId'] }
|
||||
|
|
|
@ -46,7 +46,7 @@ module Fog
|
|||
for id in instance_id
|
||||
instance = self.data[:instances][id]
|
||||
instance['classicLinkSecurityGroups'] = nil
|
||||
instance['classicLinkVpc'] = nil
|
||||
instance['classicLinkVpcId'] = nil
|
||||
self.data[:deleted_at][id] = Time.now
|
||||
code = case instance['instanceState']['name']
|
||||
when 'pending'
|
||||
|
|
Loading…
Reference in a new issue