lib/fog/qingcloud/models/compute/security_group_rule.rb in ns-fog-1.22.8 vs lib/fog/qingcloud/models/compute/security_group_rule.rb in ns-fog-1.22.9
- old
+ new
@@ -74,11 +74,10 @@
return nil if protocol == 'icmp'
port_end = val2.empty? ? val1 : val2
(val1.to_i .. port_end.to_i)
end
- private
def to_range(stuff)
if stuff.is_a? Range
[stuff.first, stuff.end]
elsif stuff.is_a? Integer
[stuff, stuff]
@@ -87,12 +86,13 @@
def to_query(n = 1)
query = ['protocol', 'priority', 'action',
'direction', 'val1', 'val2', 'val3'
].inject({}) do |ret, x|
- ret["rules.%d.#{x}" % n] = send(x.to_sym)
+ ret["rules.#{n}.#{x}"] = send(x.to_sym)
+ ret
end
- query['rules.%d.security_group_rule_name' % n] = name
+ query["rules.#{n}.security_group_rule_name"] = name
query
end
end
end
end