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

add wait_for to handle eventual consistency

* fix specs
This commit is contained in:
Eugene Howe 2016-10-12 08:55:15 -04:00
parent e2b1c3dc25
commit fa33de7d2f
2 changed files with 4 additions and 2 deletions

View file

@ -25,8 +25,8 @@ module Fog
class Mock
def create_mount_target(file_system_id, subnet_id, options={})
response = Excon::Response.new
default_security_group = mock_compute.security_groups.detect { |sg| sg.description == 'default group' }
security_groups = options["SecurityGroups"] || [default_security_group.group_id]
default_security_group = mock_compute.data[:security_groups]['default']
security_groups = options["SecurityGroups"] || [default_security_group['groupId']]
unless file_system = self.data[:file_systems][file_system_id]
raise Fog::AWS::EFS::NotFound.new("invalid file system ID: #{file_system_id}")

View file

@ -95,6 +95,8 @@ Shindo.tests('AWS::EFS | file systems', ['aws', 'efs']) do
end
end
Fog.wait_for { Fog::AWS[:efs].describe_mount_target_security_groups(mount_target_id).body["SecurityGroups"] != [default_security_group.group_id] }
tests("#describe_mount_target_security_groups(#{mount_target_id})").formats(AWS::EFS::Formats::DESCRIBE_MOUNT_TARGET_SECURITY_GROUPS_FORMAT) do
result = Fog::AWS[:efs].describe_mount_target_security_groups(mount_target_id).body
returns([security_group.group_id]) { result["SecurityGroups"] }