mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
Security Group perms of FromPort 0 and ToPort -1
Fix generation of the FromPort and ToPort paramters when authorizing or revoking permissions on a security group. Using `min` and `max` to get the parts of a range can somtimes return nil, using `begin` and `end` will always return the actual values the range was created with Example: `(0..-1).min` is nil and `(0..-1).max` is also nil Error message from AWS would be: Invalid value 'Must specify both from and to ports with ICMP.' for portRange
This commit is contained in:
parent
57290fc5da
commit
4abac8e454
1 changed files with 4 additions and 4 deletions
|
@ -83,8 +83,8 @@ module Fog
|
|||
requires_one :name, :group_id
|
||||
|
||||
ip_permission = {
|
||||
'FromPort' => range.min,
|
||||
'ToPort' => range.max,
|
||||
'FromPort' => range.begin,
|
||||
'ToPort' => range.end,
|
||||
'IpProtocol' => options[:ip_protocol] || 'tcp'
|
||||
}
|
||||
|
||||
|
@ -197,8 +197,8 @@ module Fog
|
|||
requires_one :name, :group_id
|
||||
|
||||
ip_permission = {
|
||||
'FromPort' => range.min,
|
||||
'ToPort' => range.max,
|
||||
'FromPort' => range.begin,
|
||||
'ToPort' => range.end,
|
||||
'IpProtocol' => options[:ip_protocol] || 'tcp'
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue