mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[AWS|ELB] emulate AWS behavior: no BackendServerDescriptions by default
This commit is contained in:
parent
99389245ae
commit
5e88bb0606
2 changed files with 2 additions and 6 deletions
|
@ -65,9 +65,6 @@ module Fog
|
|||
|
||||
certificate_ids = Fog::AWS::IAM::Mock.data[@aws_access_key_id][:server_certificates].map {|n, c| c['Arn'] }
|
||||
|
||||
instance_ports = listeners.map{|l| l["InstancePort"] }
|
||||
backend_server_descriptions = instance_ports.map {|port| {'InstancePort' => port } }
|
||||
|
||||
listeners = [*listeners].map do |listener|
|
||||
if listener['SSLCertificateId'] and !certificate_ids.include? listener['SSLCertificateId']
|
||||
raise Fog::AWS::IAM::NotFound.new('CertificateNotFound')
|
||||
|
@ -89,7 +86,7 @@ module Fog
|
|||
|
||||
self.data[:load_balancers][lb_name] = {
|
||||
'AvailabilityZones' => availability_zones,
|
||||
'BackendServerDescriptions' => backend_server_descriptions,
|
||||
'BackendServerDescriptions' => [],
|
||||
'Subnets' => options[:subnet_ids] || [],
|
||||
'Scheme' => options[:scheme].nil? ? 'internet-facing' : options[:scheme],
|
||||
'SecurityGroups' => options[:security_groups].nil? ? [] : options[:security_groups],
|
||||
|
|
|
@ -284,8 +284,7 @@ Shindo.tests('AWS::ELB | models', ['aws', 'elb']) do
|
|||
|
||||
tests('backend server descriptions') do
|
||||
tests('default') do
|
||||
returns(1) { elb.backend_server_descriptions.size }
|
||||
returns(80) { elb.backend_server_descriptions.first.instance_port }
|
||||
returns(0) { elb.backend_server_descriptions.size }
|
||||
end
|
||||
|
||||
tests('with a backend policy') do
|
||||
|
|
Loading…
Add table
Reference in a new issue