Don't do glance v2 calls when config is set to v1

Fixes bug 1252549

Change-Id: I6d9509bfecd2f73040a0ad27aff8fc5f6fd0a899
This commit is contained in:
Sam Morrison 2013-11-19 15:20:05 +11:00
parent 1099f09a2d
commit a5424f700e
1 changed files with 3 additions and 0 deletions

View 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)