Fix IsDefault bug in elbv2 describe_rules (#4204)

This commit is contained in:
Evan O'Connell 2021-08-20 21:50:10 -07:00 committed by GitHub
parent b9c7ec383c
commit 25e79c6e67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -965,7 +965,7 @@ DESCRIBE_RULES_TEMPLATE = """<DescribeRulesResponse xmlns="http://elasticloadbal
<Rules>
{% for rule in rules %}
<member>
<IsDefault>{{ "true" if rules.is_default else "false" }}</IsDefault>
<IsDefault>{{ "true" if rule.is_default else "false" }}</IsDefault>
<Conditions>
{% for condition in rule.conditions %}
<member>

View File

@ -1166,6 +1166,9 @@ def test_handle_listener_rules():
first_rule = obtained_rules["Rules"][0]
second_rule = obtained_rules["Rules"][1]
third_rule = obtained_rules["Rules"][2]
default_rule = obtained_rules["Rules"][3]
first_rule["IsDefault"].should.equal(False)
default_rule["IsDefault"].should.equal(True)
obtained_rules = conn.describe_rules(RuleArns=[first_rule["RuleArn"]])
obtained_rules["Rules"].should.equal([first_rule])