summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Waldon <brian.waldon@rackspace.com>2011-08-30 14:52:23 -0400
committerBrian Waldon <brian.waldon@rackspace.com>2011-08-30 14:52:23 -0400
commit09fd29a9cc29904679cc8921adaf7559c23f347f (patch)
tree3c67bdfbe50adc42e48db70d8cc2f4c171b8ebf7
parent980ae6aa2f3797e428beee6e383d8bd134175734 (diff)
downloadnova-09fd29a9cc29904679cc8921adaf7559c23f347f.tar.gz
nova-09fd29a9cc29904679cc8921adaf7559c23f347f.tar.xz
nova-09fd29a9cc29904679cc8921adaf7559c23f347f.zip
fixing short-ciruit condition
-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']