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

fix describe mount targets

This commit is contained in:
Eugene Howe 2016-10-10 16:34:26 -04:00
parent 824c271ae4
commit eb99011251
3 changed files with 7 additions and 1 deletions

View file

@ -159,6 +159,8 @@ module Fog
raise Fog::AWS::EFS::IncorrectFileSystemLifeCycleState.slurp(error, match[:message])
elsif match[:code] == 'FileSystemInUse'
raise Fog::AWS::EFS::FileSystemInUse.slurp(error, match[:message])
elsif match[:code] == 'MountTargetNotFound'
raise Fog::AWS::EFS::NotFound.slurp(error, match[:message])
end
raise case match[:message]
when /invalid ((file system)|(mount target)|(security group)) id/i

View file

@ -39,7 +39,7 @@ module Fog
if mount_target = self.data[:mount_targets][id]
[mount_target]
else
raise Fog::AWS::EFS::NotFound.new("invalid file system ID: #{id}")
raise Fog::AWS::EFS::NotFound.new("Mount target does not exist.")
end
elsif file_system_id = options[:file_system_id]
self.data[:mount_targets].values.select { |mt| mt["FileSystemId"] == file_system_id }

View file

@ -105,6 +105,10 @@ Shindo.tests('AWS::EFS | file systems', ['aws', 'efs']) do
Fog::AWS[:efs].describe_mount_targets(:id => mount_target_id).body
end
raises(Fog::AWS::EFS::NotFound, 'Mount target does not exist.') do
Fog::AWS[:efs].describe_mount_targets(:id => "foobar")
end
raises(Fog::AWS::EFS::Error, 'file system ID or mount target ID must be specified') do
Fog::AWS[:efs].describe_mount_targets
end