summaryrefslogtreecommitdiff
path: root/nova/image/glance.py
diff options
context:
space:
mode:
Diffstat (limited to 'nova/image/glance.py')
-rw-r--r--nova/image/glance.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/nova/image/glance.py b/nova/image/glance.py
index b00c5da169..6344a3cb11 100644
--- a/nova/image/glance.py
+++ b/nova/image/glance.py
@@ -18,6 +18,7 @@
from __future__ import absolute_import
import copy
+import inspect
import itertools
import random
import sys
@@ -227,7 +228,12 @@ class GlanceClientWrapper(object):
client = self.client or self._create_onetime_client(context,
version)
try:
- return getattr(client.images, method)(*args, **kwargs)
+ result = getattr(client.images, method)(*args, **kwargs)
+ if inspect.isgenerator(result):
+ # Convert generator results to a list, so that we can
+ # catch any potential exceptions now and retry the call.
+ return list(result)
+ return result
except retry_excs as e:
host = self.host
port = self.port