From d9f63269f1a0205811cd84487787c8c1291a952b Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Wed, 26 Sep 2012 14:51:08 +0100 Subject: [PATCH] heat : fix glanceclient deprecation warning glanceclient module name changed for F18, so do a conditional import which should import the correct version provided one is available (tested on F17/F18) Fixes #251 Change-Id: I095560f29a408949a7d54795fc000c094b1d63b9 Signed-off-by: Steven Hardy --- heat/tests/functional/util.py | 5 ++++- heat/utils.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/heat/tests/functional/util.py b/heat/tests/functional/util.py index b9f6e064..bb88ec14 100644 --- a/heat/tests/functional/util.py +++ b/heat/tests/functional/util.py @@ -33,7 +33,10 @@ from nose.plugins.attrib import attr from nose import with_setup from nose.exc import SkipTest -from glance import client as glance_client +try: + from glanceclient import client as glance_client +except ImportError: + from glance import client as glance_client from novaclient.v1_1 import client as nova_client import heat from heat import utils diff --git a/heat/utils.py b/heat/utils.py index 528b40dd..bc39b6cf 100644 --- a/heat/utils.py +++ b/heat/utils.py @@ -21,7 +21,10 @@ import base64 from lxml import etree import re -from glance import client as glance_client +try: + from glanceclient import client as glance_client +except ImportError: + from glance import client as glance_client from heat.common import exception from heat.openstack.common import log as logging -- 2.45.2