From f8279d69729e40e3aa3cc732bc0a7b2d4f2bbc93 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Wed, 21 Dec 2016 18:39:21 -0800 Subject: [PATCH] Fixes a bug where pagination was incorrect. (#628) --- lemur/plugins/lemur_aws/elb.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lemur/plugins/lemur_aws/elb.py b/lemur/plugins/lemur_aws/elb.py index ac079645..0e6c78c6 100644 --- a/lemur/plugins/lemur_aws/elb.py +++ b/lemur/plugins/lemur_aws/elb.py @@ -63,11 +63,10 @@ def get_all_elbs(**kwargs): elbs += response['LoadBalancerDescriptions'] - if not response.get('IsTruncated'): + if not response.get('NextMarker'): return elbs - - if response['NextMarker']: - kwargs.update(dict(marker=response['NextMarker'])) + else: + kwargs.update(dict(Marker=response['NextMarker'])) def get_all_elbs_v2(**kwargs): @@ -83,11 +82,10 @@ def get_all_elbs_v2(**kwargs): response = get_elbs_v2(**kwargs) elbs += response['LoadBalancers'] - if not response.get('IsTruncated'): + if not response.get('NextMarker'): return elbs - - if response['NextMarker']: - kwargs.update(dict(marker=response['NextMarker'])) + else: + kwargs.update(dict(Marker=response['NextMarker'])) @sts_client('elbv2')