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