|
|
@ -312,7 +312,7 @@ def ec2_connect(module):
|
|
|
|
return ec2
|
|
|
|
return ec2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def paging(pause=0, marker_property='marker'):
|
|
|
|
def paging(pause=0, marker_property='marker', result_key=None):
|
|
|
|
""" Adds paging to boto retrieval functions that support a 'marker'
|
|
|
|
""" Adds paging to boto retrieval functions that support a 'marker'
|
|
|
|
this is configurable as not all boto functions seem to use the
|
|
|
|
this is configurable as not all boto functions seem to use the
|
|
|
|
same name.
|
|
|
|
same name.
|
|
|
@ -323,8 +323,12 @@ def paging(pause=0, marker_property='marker'):
|
|
|
|
marker = None
|
|
|
|
marker = None
|
|
|
|
while True:
|
|
|
|
while True:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
new = f(*args, marker=marker, **kwargs)
|
|
|
|
if marker:
|
|
|
|
marker = getattr(new, marker_property)
|
|
|
|
kwargs[marker_property] = marker
|
|
|
|
|
|
|
|
new = f(*args, **kwargs)
|
|
|
|
|
|
|
|
marker = new.get(marker_property)
|
|
|
|
|
|
|
|
if result_key:
|
|
|
|
|
|
|
|
new = new[result_key]
|
|
|
|
results.extend(new)
|
|
|
|
results.extend(new)
|
|
|
|
if not marker:
|
|
|
|
if not marker:
|
|
|
|
break
|
|
|
|
break
|
|
|
|