From 73a1c03580fd0ba383e6130d264844b1c90ad524 Mon Sep 17 00:00:00 2001 From: Dave Golombek Date: Mon, 5 Mar 2018 16:52:56 -0500 Subject: [PATCH] Fix handling of PageSize for ELB/ELBv2 Resolves #1497 --- moto/elb/responses.py | 2 +- moto/elbv2/responses.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/moto/elb/responses.py b/moto/elb/responses.py index b1980c9b2..40d6ec2f9 100644 --- a/moto/elb/responses.py +++ b/moto/elb/responses.py @@ -61,7 +61,7 @@ class ELBResponse(BaseResponse): start = all_names.index(marker) + 1 else: start = 0 - page_size = self._get_param('PageSize', 50) # the default is 400, but using 50 to make testing easier + page_size = self._get_int_param('PageSize', 50) # the default is 400, but using 50 to make testing easier load_balancers_resp = all_load_balancers[start:start + page_size] next_marker = None if len(all_load_balancers) > start + page_size: diff --git a/moto/elbv2/responses.py b/moto/elbv2/responses.py index 7c71ce78a..1814f1273 100644 --- a/moto/elbv2/responses.py +++ b/moto/elbv2/responses.py @@ -242,7 +242,7 @@ class ELBV2Response(BaseResponse): start = all_names.index(marker) + 1 else: start = 0 - page_size = self._get_param('PageSize', 50) # the default is 400, but using 50 to make testing easier + page_size = self._get_int_param('PageSize', 50) # the default is 400, but using 50 to make testing easier load_balancers_resp = all_load_balancers[start:start + page_size] next_marker = None if len(all_load_balancers) > start + page_size: @@ -468,7 +468,7 @@ class ELBV2Response(BaseResponse): def describe_account_limits(self): # Supports paging but not worth implementing yet # marker = self._get_param('Marker') - # page_size = self._get_param('PageSize') + # page_size = self._get_int_param('PageSize') limits = { 'application-load-balancers': 20, @@ -489,7 +489,7 @@ class ELBV2Response(BaseResponse): names = self._get_multi_param('Names.member.') # Supports paging but not worth implementing yet # marker = self._get_param('Marker') - # page_size = self._get_param('PageSize') + # page_size = self._get_int_param('PageSize') policies = SSL_POLICIES if names: