]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Don't do glance v2 calls when config is set to v1
authorSam Morrison <sorrison@gmail.com>
Tue, 19 Nov 2013 04:20:05 +0000 (15:20 +1100)
committerSam Morrison <sorrison@gmail.com>
Thu, 21 Nov 2013 00:06:48 +0000 (11:06 +1100)
Fixes bug 1252549

Change-Id: I6d9509bfecd2f73040a0ad27aff8fc5f6fd0a899

cinder/image/glance.py

index 84e9a6980db8b6c3f12dc4db71ecf1c1763e12cf..641c337935b8058bcd0401199c56cc392311a7f9 100644 (file)
@@ -233,6 +233,9 @@ class GlanceImageService(object):
         """Returns the direct url representing the backend storage location,
         or None if this attribute is not shown by Glance.
         """
+        if CONF.glance_api_version == 1:
+            # image location not available in v1
+            return (None, None)
         try:
             # direct_url is returned by v2 api
             client = GlanceClientWrapper(version=2)