Fix condition filtering bug in elbv2.create_rule() (#3092)

* Fix condition filtering bug

* Update test_handle_listener_rules unit test

* Run black
This commit is contained in:
Adrian 2020-06-27 01:42:32 -07:00 committed by GitHub
commit 73813460b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 2 deletions

View file

@ -158,7 +158,7 @@ class ELBV2Response(BaseResponse):
condition = {}
condition["field"] = _condition["field"]
values = sorted(
[e for e in _condition.items() if e[0].startswith("values.member")],
[e for e in _condition.items() if "values.member" in e[0]],
key=lambda x: x[0],
)
condition["values"] = [e[1] for e in values]
@ -356,7 +356,7 @@ class ELBV2Response(BaseResponse):
condition = {}
condition["field"] = _condition["field"]
values = sorted(
[e for e in _condition.items() if e[0].startswith("values.member")],
[e for e in _condition.items() if "values.member" in e[0]],
key=lambda x: x[0],
)
condition["values"] = [e[1] for e in values]