diff --git a/moto/elb/responses.py b/moto/elb/responses.py index 2bc76385f..ec20486f0 100644 --- a/moto/elb/responses.py +++ b/moto/elb/responses.py @@ -159,9 +159,8 @@ class ELBResponse(BaseResponse): if connection_draining: attribute = ConnectionDrainingAttribute() attribute.enabled = connection_draining["enabled"] == "true" - attribute.timeout = connection_draining.get("timeout") - self.elb_backend.set_connection_draining_attribute( - load_balancer_name, attribute) + attribute.timeout = connection_draining.get("timeout", 300) + self.elb_backend.set_connection_draining_attribute(load_balancer_name, attribute) connection_settings = self._get_dict_param( "LoadBalancerAttributes.ConnectionSettings.") @@ -172,7 +171,7 @@ class ELBResponse(BaseResponse): load_balancer_name, attribute) template = self.response_template(MODIFY_ATTRIBUTES_TEMPLATE) - return template.render(attributes=load_balancer.attributes) + return template.render(load_balancer=load_balancer, attributes=load_balancer.attributes) def create_load_balancer_policy(self): load_balancer_name = self._get_param('LoadBalancerName') @@ -592,9 +591,11 @@ DESCRIBE_ATTRIBUTES_TEMPLATE = """{{ attributes.cross_zone_load_balancing.enabled }} - {{ attributes.connection_draining.enabled }} {% if attributes.connection_draining.enabled %} + true {{ attributes.connection_draining.timeout }} + {% else %} + false {% endif %} @@ -607,7 +608,7 @@ DESCRIBE_ATTRIBUTES_TEMPLATE = """ - my-loadbalancer + {{ load_balancer.name }} {{ attributes.access_log.enabled }} @@ -624,9 +625,11 @@ MODIFY_ATTRIBUTES_TEMPLATE = """