From 7062e086d44390006f48458ccc6c8d8fff40a857 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 15 Apr 2016 10:36:45 -0400 Subject: [PATCH] made paging marker configurable as boto differs --- lib/ansible/module_utils/ec2.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/ansible/module_utils/ec2.py b/lib/ansible/module_utils/ec2.py index 8b932424a2..158f050ad7 100644 --- a/lib/ansible/module_utils/ec2.py +++ b/lib/ansible/module_utils/ec2.py @@ -238,8 +238,11 @@ def ec2_connect(module): return ec2 -def paging(pause=0): - """ Adds paging to boto retrieval functions that support 'marker' """ +def paging(pause=0, marker_property='marker'): + """ Adds paging to boto retrieval functions that support a 'marker' + this is configurable as not all boto functions seem to use the + same name. + """ def wrapper(f): def page(*args, **kwargs): results = [] @@ -247,7 +250,7 @@ def paging(pause=0): while True: try: new = f(*args, marker=marker, **kwargs) - marker = new.next_marker + marker = getattr(new, marker_property) results.extend(new) if not marker: break