summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
Diffstat (limited to 'nova')
-rw-r--r--nova/image/glance.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/nova/image/glance.py b/nova/image/glance.py
index f2f246ba6..b5f52351f 100644
--- a/nova/image/glance.py
+++ b/nova/image/glance.py
@@ -141,12 +141,13 @@ class GlanceImageService(service.BaseImageService):
"""Paginate through results from glance server"""
images = fetch_func(**kwargs)
- for image in images:
- yield image
- else:
+ if not images:
# break out of recursive loop to end pagination
return
+ for image in images:
+ yield image
+
try:
# attempt to advance the marker in order to fetch next page
kwargs['marker'] = images[-1]['id']