Merge pull request #351 from kpdonn/master
Fix bug creating elb with a listener certificate
This commit is contained in:
commit
55f36a3a43
@ -31,7 +31,7 @@ class ELBResponse(BaseResponse):
|
|||||||
break
|
break
|
||||||
lb_port = self.querystring['Listeners.member.{0}.LoadBalancerPort'.format(port_index)][0]
|
lb_port = self.querystring['Listeners.member.{0}.LoadBalancerPort'.format(port_index)][0]
|
||||||
instance_port = self.querystring['Listeners.member.{0}.InstancePort'.format(port_index)][0]
|
instance_port = self.querystring['Listeners.member.{0}.InstancePort'.format(port_index)][0]
|
||||||
ssl_certificate_id = self.querystring.get('Listeners.member.{0}.SSLCertificateId'.format(port_index)[0], None)
|
ssl_certificate_id = self.querystring.get('Listeners.member.{0}.SSLCertificateId'.format(port_index), [None])[0]
|
||||||
ports.append([protocol, lb_port, instance_port, ssl_certificate_id])
|
ports.append([protocol, lb_port, instance_port, ssl_certificate_id])
|
||||||
port_index += 1
|
port_index += 1
|
||||||
|
|
||||||
|
@ -48,6 +48,24 @@ def test_create_elb_in_multiple_region():
|
|||||||
list(west1_conn.get_all_load_balancers()).should.have.length_of(1)
|
list(west1_conn.get_all_load_balancers()).should.have.length_of(1)
|
||||||
list(west2_conn.get_all_load_balancers()).should.have.length_of(1)
|
list(west2_conn.get_all_load_balancers()).should.have.length_of(1)
|
||||||
|
|
||||||
|
@mock_elb
|
||||||
|
def test_create_load_balancer_with_certificate():
|
||||||
|
conn = boto.connect_elb()
|
||||||
|
|
||||||
|
zones = ['us-east-1a']
|
||||||
|
ports = [(443, 8443, 'https', 'arn:aws:iam:123456789012:server-certificate/test-cert')]
|
||||||
|
conn.create_load_balancer('my-lb', zones, ports)
|
||||||
|
|
||||||
|
balancers = conn.get_all_load_balancers()
|
||||||
|
balancer = balancers[0]
|
||||||
|
balancer.name.should.equal("my-lb")
|
||||||
|
set(balancer.availability_zones).should.equal(set(['us-east-1a']))
|
||||||
|
listener = balancer.listeners[0]
|
||||||
|
listener.load_balancer_port.should.equal(443)
|
||||||
|
listener.instance_port.should.equal(8443)
|
||||||
|
listener.protocol.should.equal("HTTPS")
|
||||||
|
listener.ssl_certificate_id.should.equal('arn:aws:iam:123456789012:server-certificate/test-cert')
|
||||||
|
|
||||||
|
|
||||||
@mock_elb
|
@mock_elb
|
||||||
def test_add_listener():
|
def test_add_listener():
|
||||||
|
Loading…
Reference in New Issue
Block a user