1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
This commit is contained in:
Angelo Marletta 2013-07-03 12:37:11 +01:00
parent dd10f93006
commit ed8063c9d3
2 changed files with 6 additions and 6 deletions

View file

@ -13,7 +13,7 @@ module Fog
# * options<~Hash> # * options<~Hash>
# * 'SnapshotId'<~String> - Optional, snapshot to create volume from # * 'SnapshotId'<~String> - Optional, snapshot to create volume from
# * 'VolumeType'<~String> - Optional, volume type. standard or io1, default is standard. # * 'VolumeType'<~String> - Optional, volume type. standard or io1, default is standard.
# * 'Iops'<~Integer> - Number of IOPS the volume supports. Required if VolumeType is io1, must be between 1 and 1000. # * 'Iops'<~Integer> - Number of IOPS the volume supports. Required if VolumeType is io1, must be between 1 and 4000.
# #
# ==== Returns # ==== Returns
# * response<~Excon::Response>: # * response<~Excon::Response>:
@ -83,8 +83,8 @@ module Fog
raise Fog::Compute::AWS::Error.new("VolumeIOPSLimit => Volume iops of #{iops} is too low; minimum is 100.") raise Fog::Compute::AWS::Error.new("VolumeIOPSLimit => Volume iops of #{iops} is too low; minimum is 100.")
end end
if iops > 2000 if iops > 4000
raise Fog::Compute::AWS::Error.new("VolumeIOPSLimit => Volume iops of #{iops} is too high; maximum is 2000.") raise Fog::Compute::AWS::Error.new("VolumeIOPSLimit => Volume iops of #{iops} is too high; maximum is 4000.")
end end
end end

View file

@ -192,9 +192,9 @@ Shindo.tests('Fog::Compute[:aws] | volume requests', ['aws']) do
Fog::Compute[:aws].create_volume(@server.availability_zone, 10, 'VolumeType' => 'io1', 'Iops' => 99) Fog::Compute[:aws].create_volume(@server.availability_zone, 10, 'VolumeType' => 'io1', 'Iops' => 99)
end end
# iops invalid value (greater than 2000) # iops invalid value (greater than 4000)
tests("#create_volume('#{@server.availability_zone}', 1024, 'VolumeType' => 'io1', 'Iops' => 2001)").raises(Fog::Compute::AWS::Error) do tests("#create_volume('#{@server.availability_zone}', 1024, 'VolumeType' => 'io1', 'Iops' => 4001)").raises(Fog::Compute::AWS::Error) do
Fog::Compute[:aws].create_volume(@server.availability_zone, 1024, 'VolumeType' => 'io1', 'Iops' => 2001) Fog::Compute[:aws].create_volume(@server.availability_zone, 1024, 'VolumeType' => 'io1', 'Iops' => 4001)
end end
@volume.destroy @volume.destroy