From a9319fad04b2466930c5764ffd83bc5fd4349a9a Mon Sep 17 00:00:00 2001 From: Niels Laukens Date: Fri, 14 Jun 2019 16:15:14 +0200 Subject: [PATCH] Route53 get_record_sets: filter type after name According to the documentation [1], name should be filtered first, followed by type. > If you specify both Name and Type > The results begin with the first resource record set in the list > whose name is greater than or equal to Name, and whose type is > greater than or equal to Type. [1]: https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListResourceRecordSets.html --- moto/route53/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/moto/route53/models.py b/moto/route53/models.py index 3760d3817..4e85c172b 100644 --- a/moto/route53/models.py +++ b/moto/route53/models.py @@ -200,12 +200,12 @@ class FakeZone(BaseModel): def get_record_sets(self, start_type, start_name): record_sets = list(self.rrsets) # Copy the list - if start_type: - record_sets = [ - record_set for record_set in record_sets if record_set.type_ >= start_type] if start_name: record_sets = [ record_set for record_set in record_sets if record_set.name >= start_name] + if start_type: + record_sets = [ + record_set for record_set in record_sets if record_set.type_ >= start_type] return record_sets